/ Published in: PHP
Wordpress admin area functions
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// ======================== // = Admin Area Functions = // ======================== require_once(TEMPLATEPATH . '/help_page.php'); // After Registration Redirect function __my_registration_redirect() { return home_url( '/thank-you-for-registering' ); } add_filter( 'registration_redirect', '__my_registration_redirect' ); // Remove Generator remove_action('wp_head', 'wp_generator'); // Admin Footer function remove_footer_admin () { echo "<strong>CTRM Center</strong> created by <a href=\"http://www.andrewcolby.com\">Andrew Colby</a>"; } add_filter('admin_footer_text', 'remove_footer_admin'); // Remove Default Dashboard Items function example_remove_dashboard_widgets() { // Globalize the metaboxes array, this holds all the widgets for wp-admin global $wp_meta_boxes; // Remove the incomming links widget // Plugins // EasymMail // Remove right now //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); } // Hoook into the 'wp_dashboard_setup' action to register our function add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' ); // remove unnecessary page/post meta boxes function remove_meta_boxes() { // posts remove_meta_box('postcustom','post','normal'); remove_meta_box('trackbacksdiv','post','normal'); remove_meta_box('slugdiv','post','normal'); //remove_meta_box('commentstatusdiv','post','normal'); //remove_meta_box('commentsdiv','post','normal'); //remove_meta_box('categorydiv','post','normal'); //remove_meta_box('tagsdiv-post_tag','post','normal'); //remove_meta_box('authordiv','post','normal'); // pages remove_meta_box('postcustom','page','normal'); remove_meta_box('commentstatusdiv','page','normal'); remove_meta_box('trackbacksdiv','page','normal'); remove_meta_box('commentsdiv','page','normal'); remove_meta_box('slugdiv','page','normal'); //remove_meta_box('authordiv','page','normal'); } add_action('admin_init','remove_meta_boxes'); // Screen Options - Remove Columns function my_remove_columns( $posts_columns ) { return $posts_columns; } add_filter( 'manage_post_posts_columns', 'my_remove_columns' ); add_action( 'admin_menu', 'my_remove_meta_boxes' ); // Remove WP Logo function annointed_admin_bar_remove() { global $wp_admin_bar; /* Remove their stuff */ $wp_admin_bar->remove_menu('wp-logo'); $wp_admin_bar->remove_menu('comments'); } add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);