Changeset 779738
- Timestamp:
- 09/28/2013 11:08:42 PM (11 years ago)
- Location:
- dashboard/trunk
- Files:
-
- 1 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
dashboard/trunk/css/rightnow.css
r779007 r779738 3 3 #dash-right-now .inside { 4 4 margin-bottom: 0; 5 overflow: hidden; 5 6 padding: 0; 6 7 } … … 8 9 #dash-right-now .main { 9 10 padding: 0 12px; 11 } 12 13 #dash-right-now .main p { 14 margin-top: 10px; 15 } 16 17 #dash-right-now ul, 18 .mu-storage { 19 overflow: hidden; 10 20 } 11 21 -
dashboard/trunk/dashboard.php
r779007 r779738 17 17 18 18 private $active_modules = array( 19 'dashboard',20 19 //'combinednews', 21 20 'quickdraft', … … 26 25 self::$instance = $this; 27 26 28 add_action( 'admin_menu', array( $this , 'dash_add_menu' ) ); 27 // Override dashboard temporarily 28 add_action( 'load-index.php', array( $this , 'override_dashboard' ) ); 29 30 // Load JS & CSS 29 31 add_action( 'admin_enqueue_scripts', array( $this , 'enqueue_scripts' ) ); 30 32 33 // Load new module files 31 34 foreach ( $this->active_modules as $module_slug ) include plugin_dir_path( __FILE__ ) . $module_slug . '.php'; 32 35 $this->screen = 'dashboard'; 33 36 } 34 37 35 38 function enqueue_scripts() { 36 39 if ( get_current_screen()->base !== $this->screen && get_current_screen()->base !== 'dashboard' ) … … 45 48 } 46 49 47 function dash_add_menu() { 48 $this->screen = add_dashboard_page( 'Dash', 'Dash', 'read', 'dash-dash', array( $this, 'dash_page' ) ); 49 } 50 51 function dash_page() { 52 ?> 53 <div class="wrap"> 54 55 <h2><?php $words = array( 'Hola', 'Bonjour', 'Aloha', 'Ahoy There', "G'day", "It's Go Time", 'Break a Leg', 'Go For Broke' ); echo esc_html( $words[ mt_rand( 0, count( $words) -1 ) ] ); ?></h2> 56 57 </div><!-- .wrap --> 58 <?php 59 } 50 function override_dashboard() { 51 if ( get_current_screen()->in_admin( 'site' ) ) { 52 require dirname( __FILE__ ) . '/dashboard-override.php'; 53 exit; 54 } 55 } 60 56 } 61 57 new Plugin_Dashboard; -
dashboard/trunk/quickdraft.php
r767441 r779738 1 1 <?php 2 3 // Remove the QuickPress widget from the dashboard4 add_action( 'wp_dashboard_setup', 'remove_quickpress_and_recent_drafts_dashboard_widgets' );5 6 function remove_quickpress_and_recent_drafts_dashboard_widgets() {7 remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );8 remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );9 }10 2 11 3 // Add the QuickDraft widget to the dashboard … … 13 5 14 6 function add_quickdraft_dashboard_widget() { 15 if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { 16 wp_add_dashboard_widget( 'dashboard_quick_draft', __( 'QuickDraft' ), 'wp_dashboard_quick_draft' ); 17 } 7 if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) 8 add_meta_box('dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high'); 18 9 } 19 10 -
dashboard/trunk/rightnow.php
r779007 r779738 39 39 </li> 40 40 </ul> 41 <div style="clear:both;"></div>42 41 </div> 43 42 <?php … … 46 45 function dash_add_new_right_now() { 47 46 remove_meta_box( 'dashboard_right_now', 'dashboard', 'side' ); 48 wp_add_dashboard_widget( 'dash-right-now', 'New Right Now', 'dash_new_right_now');47 add_meta_box('dash-right-now', 'Site Content', 'dash_new_right_now', 'dashboard', 'normal', 'high'); 49 48 remove_action( 'activity_box_end', 'wp_dashboard_quota' ); 50 49 add_action( 'activity_box_end', 'dash_new_dashboard_quota' ); … … 98 97 ?> 99 98 </ul> 100 <div style="clear:both;"></div>101 99 <p><?php printf( __('<b>WordPress %1$s</b> running %2$s theme.' ), get_bloginfo( 'version', 'display' ), $theme_name ); ?></p> 102 100 </div>
Note: See TracChangeset
for help on using the changeset viewer.