Make WordPress Core

Changeset 9748


Ignore:
Timestamp:
11/18/2008 01:04:41 AM (16 years ago)
Author:
ryan
Message:

Dashboard pluggability improvements from mdawaffe. see #8265

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/dashboard.css

    r9733 r9748  
    8484    margin: 0 0 .2em;
    8585    padding: 0;
     86}
     87
     88#dashboard-widgets .heading {
     89    font-size: 1em;
     90    font-weight: normal;
     91    font-style: italic;
     92    font-family: Georgia, serif;
    8693}
    8794
  • trunk/wp-admin/includes/dashboard.php

    r9729 r9748  
    9292    $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
    9393
     94    foreach ( $dashboard_widgets as $widget_id ) {
     95        $name = empty( $wp_registered_widgets[$widget_id]['all_link'] ) ? $wp_registered_widgets[$widget_id]['name'] : $wp_registered_widgets[$widget_id]['name'] . " <a href='{$wp_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>" . __('View all') . '</a>';
     96        wp_add_dashboard_widget( $widget_id, $name, $wp_registered_widgets[$widget_id]['callback'], $wp_registered_widget_controls[$widget_id]['callback'] );
     97    }
     98
    9499    if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) {
    95100        ob_start(); // hack - but the same hack wp-admin/widgets.php uses
     
    102107    if ( $update )
    103108        update_option( 'dashboard_widget_options', $widget_options );
    104 
    105     foreach ( $dashboard_widgets as $widget_id )
    106         wp_add_dashboard_widget( $widget_id, $wp_registered_widgets[$widget_id]['name'], $wp_registered_widgets[$widget_id]['callback'], $wp_registered_widget_controls[$widget_id]['callback'] );
    107109
    108110    do_action('do_meta_boxes', 'dashboard', 'normal', '');
     
    131133
    132134function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
    133     echo '<form action="" method="post">';
     135    echo '<form action="" method="post" class="dashboard-widget-control-form">';
    134136    wp_dashboard_trigger_widget_control( $meta_box['id'] );
    135137    echo "<p class='submit'><input type='hidden' name='widget_id' value='$meta_box[id]' /><input type='submit' value='" . __( 'Submit' ) . "' /></p>";
     
    802804}
    803805
     806/**
     807 * Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).
     808 */
     809function wp_dashboard_empty() {}
     810
    804811?>
  • trunk/wp-includes/script-loader.php

    r9746 r9748  
    314314    $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' );
    315315    $styles->add( 'widgets', '/wp-admin/css/widgets.css' );
    316     $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081115' );
     316    $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081117' );
    317317    $styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' );
    318318    $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
Note: See TracChangeset for help on using the changeset viewer.