kisukedeath

Wordpress Custom Dashboard

Oct 9th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.96 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////////////////
  2. // Cambiar el pie de pagina del panel de Administración
  3. function change_footer_admin() {  
  4.     echo '&copy;2013 Kuma. Todos los derechos reservados - Web creada por <a href="http://www.kumaproductions.com">Kuma Productions</a>';  
  5. }  
  6. add_filter('admin_footer_text', 'change_footer_admin');
  7.  
  8. //////////////////////////////////////////////////////////////////////////////////////////
  9. // Borrar opciones de admin
  10.  
  11. add_action('admin_menu', 'my_remove_menu_pages');
  12.  
  13. function my_remove_menu_pages() {
  14.         //remove_menu_page('edit.php'); // Entradas
  15.         //remove_menu_page('upload.php'); // Multimedia
  16.         //remove_menu_page('link-manager.php'); // Enlaces
  17.         //remove_menu_page('edit.php?post_type=page'); // Páginas
  18.         //remove_menu_page('edit-comments.php'); // Comentarios
  19.         //remove_menu_page('themes.php'); // Apariencia
  20.         //remove_menu_page('plugins.php'); // Plugins
  21.         //remove_menu_page('users.php'); // Usuarios
  22.         //remove_menu_page('tools.php'); // Herramientas
  23.         //remove_menu_page('options-general.php'); // Ajustes
  24. }
  25.  
  26. //////////////////////////////////////////////////////////////////////////////////////////
  27.    // Eliminamos metaboxes del Dashboard
  28.  
  29. function example_remove_dashboard_widgets() {
  30.         //remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
  31.         //remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );      
  32.         //remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );    
  33.         //remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );              
  34.         //remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
  35.         //remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
  36.         //remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );  
  37.         //remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
  38.         //remove_meta_box( 'dashboard_browser_nag', 'dashboard', 'normal' );                      
  39. }
  40.  
  41. add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
  42.  
  43.  //////////////////////////////////////////////////////////////////////////////////////////
  44.    // Forzamos el escritorio a una sola columna
  45.    
  46. function so_screen_layout_columns( $columns ) {
  47.     $columns['dashboard'] = 1;
  48.     return $columns;
  49. }
  50. add_filter( 'screen_layout_columns', 'so_screen_layout_columns' );
  51.  
  52. function so_screen_layout_dashboard() {
  53.     return 1;
  54. }
  55. add_filter( 'get_user_option_screen_layout_dashboard', 'so_screen_layout_dashboard' );  
  56.  
  57. //////////////////////////////////////////////////////////////////////////////////////////
  58.     // Widget para el Dashboard
  59.  
  60.    //////////////////////////////////////////////////////////////////////////////////////////
  61.     // Widget para el Dashboard
  62.  
  63. function custom_dashboard_widget() { ?>
  64.     <img src="<?php bloginfo('template_directory'); ?>/images/logo.png" />    
  65.     <h1>¡Hola! Este es tu área personal en la web de Kumas</h1>
  66.     <p>Si necesitas ayuda en la configuraci&oacute;n y/o edici&oacute;n de este sitio no dudes en comunicarte con nosotros que gustosamente te ayudaremos en todo lo que necesites.<br /><br /><a href="http://www.kumaproductions.com" target="_blank">Kuma Productions</a></p>
  67. <?php }
  68.  
  69. add_action( 'wp_dashboard_setup', 'my_dashboard_setup_function' );
  70.  
  71. function my_dashboard_setup_function() {
  72.     add_meta_box( 'my_dashboard_widget', 'Bienvenido al editor de la web de Kumas', 'custom_dashboard_widget', 'dashboard', 'normal', 'high' );
  73. }
  74.  
  75. //////////////////////////////////////////////////////////////////////////////////////////    
  76.     // Eliminar opciones de la barra del administrador
  77.     function change_toolbar($wp_toolbar) {  
  78.         global $current_user;    
  79.         $wp_toolbar->remove_node('wp-logo');  
  80.         $wp_toolbar->remove_node('comments');
  81.         $wp_toolbar->remove_node('new-content');
  82.         //$wp_toolbar->remove_node('site-name');  
  83.     }  
  84.     add_action('admin_bar_menu', 'change_toolbar', 999);
  85.  
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment