Posted By

andrewcolby on 06/04/13


Tagged

wordpress functions wp admin area


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

lieveansia
GreyedDesign
richerimage


Wordpress Admin Area Functions


 / Published in: PHP
 

Wordpress admin area functions

  1. // ========================
  2. // = Admin Area Functions =
  3. // ========================
  4.  
  5. require_once(TEMPLATEPATH . '/help_page.php');
  6.  
  7. // After Registration Redirect
  8. function __my_registration_redirect()
  9. {
  10. return home_url( '/thank-you-for-registering' );
  11. }
  12. add_filter( 'registration_redirect', '__my_registration_redirect' );
  13.  
  14. // Remove Generator
  15. remove_action('wp_head', 'wp_generator');
  16.  
  17. // Admin Footer
  18. function remove_footer_admin () {
  19. echo "<strong>CTRM Center</strong> created by <a href=\"http://www.andrewcolby.com\">Andrew Colby</a>";
  20. }
  21. add_filter('admin_footer_text', 'remove_footer_admin');
  22.  
  23. // Remove Default Dashboard Items
  24. function example_remove_dashboard_widgets() {
  25. // Globalize the metaboxes array, this holds all the widgets for wp-admin
  26. global $wp_meta_boxes;
  27. // Remove the incomming links widget
  28. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  29. // Plugins
  30. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  31. // EasymMail
  32. unset($wp_meta_boxes['dashboard']['normal']['core']['alo-easymail-widget']);
  33. // Remove right now
  34. //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  35. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  36. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  37. }
  38. // Hoook into the 'wp_dashboard_setup' action to register our function
  39. add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
  40.  
  41. // remove unnecessary page/post meta boxes
  42. function remove_meta_boxes() {
  43. // posts
  44. remove_meta_box('postcustom','post','normal');
  45. remove_meta_box('trackbacksdiv','post','normal');
  46. remove_meta_box('slugdiv','post','normal');
  47. //remove_meta_box('commentstatusdiv','post','normal');
  48. //remove_meta_box('commentsdiv','post','normal');
  49. //remove_meta_box('categorydiv','post','normal');
  50. //remove_meta_box('tagsdiv-post_tag','post','normal');
  51. //remove_meta_box('authordiv','post','normal');
  52. // pages
  53. remove_meta_box('postcustom','page','normal');
  54. remove_meta_box('commentstatusdiv','page','normal');
  55. remove_meta_box('trackbacksdiv','page','normal');
  56. remove_meta_box('commentsdiv','page','normal');
  57. remove_meta_box('slugdiv','page','normal');
  58. //remove_meta_box('authordiv','page','normal');
  59. }
  60. add_action('admin_init','remove_meta_boxes');
  61.  
  62. // Screen Options - Remove Columns
  63. function my_remove_columns( $posts_columns ) {
  64. unset( $posts_columns['comments'] );
  65. return $posts_columns;
  66. }
  67.  
  68. add_filter( 'manage_post_posts_columns', 'my_remove_columns' );
  69.  
  70. add_action( 'admin_menu', 'my_remove_meta_boxes' );
  71.  
  72. // Remove WP Logo
  73. function annointed_admin_bar_remove() {
  74. global $wp_admin_bar;
  75. /* Remove their stuff */
  76. $wp_admin_bar->remove_menu('wp-logo');
  77. $wp_admin_bar->remove_menu('comments');
  78. }
  79. add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);

Report this snippet  

You need to login to post a comment.