Make WordPress Core

Ticket #19239: 19239.3.diff

File 19239.3.diff, 6.3 KB (added by lessbloat, 12 years ago)
  • wp-admin/includes/ajax-actions.php

     
    209209                case 'dashboard_incoming_links' :
    210210                        wp_dashboard_incoming_links();
    211211                        break;
    212                 case 'dashboard_primary' :
    213                         wp_dashboard_primary();
    214                         break;
    215                 case 'dashboard_secondary' :
    216                         wp_dashboard_secondary();
    217                         break;
    218212                case 'dashboard_plugins' :
    219213                        wp_dashboard_plugins();
    220214                        break;
  • wp-admin/includes/dashboard.php

     
    8282        if ( is_blog_admin() && current_user_can('edit_posts') )
    8383                wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
    8484
    85         // Primary feed (Dev Blog) Widget
    86         if ( !isset( $widget_options['dashboard_primary'] ) ) {
    87                 $update = true;
    88                 $widget_options['dashboard_primary'] = array(
    89                         'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
    90                         'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
    91                         'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
    92                         'items' => 2,
    93                         'show_summary' => 1,
    94                         'show_author' => 0,
    95                         'show_date' => 1,
    96                 );
    97         }
    98         wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );
    99 
    100         // Secondary Feed (Planet) Widget
    101         if ( !isset( $widget_options['dashboard_secondary'] ) ) {
    102                 $update = true;
    103                 $widget_options['dashboard_secondary'] = array(
    104                         'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
    105                         'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
    106                         'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
    107                         'items' => 5,
    108                         'show_summary' => 0,
    109                         'show_author' => 0,
    110                         'show_date' => 0,
    111                 );
    112         }
    113         wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );
    114 
    11585        // Hook to register new widgets
    11686        // Filter widget order
    11787        if ( is_network_admin() ) {
     
    163133        }
    164134
    165135        if ( is_blog_admin () )
    166                 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
     136                $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts'); /* Needs new RSS widget added */
    167137        else if (is_network_admin() )
    168                 $side_widgets = array('dashboard_primary', 'dashboard_secondary');
     138                $side_widgets = array(); /* Needs new RSS widget added */
    169139        else
    170140                $side_widgets = array();
    171141
     
    860830        wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) );
    861831}
    862832
    863 function wp_dashboard_primary() {
    864         wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
    865 }
    866 
    867 function wp_dashboard_primary_control() {
    868         wp_dashboard_rss_control( 'dashboard_primary' );
    869 }
    870 
    871 /**
    872  * Display primary dashboard RSS widget feed.
    873  *
    874  * @since 2.5.0
    875  *
    876  * @param string $widget_id
    877  */
    878 function wp_dashboard_rss_output( $widget_id ) {
    879         $widgets = get_option( 'dashboard_widget_options' );
    880         echo '<div class="rss-widget">';
    881         wp_widget_rss_output( $widgets[$widget_id] );
    882         echo "</div>";
    883 }
    884 
    885 function wp_dashboard_secondary() {
    886         wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
    887 }
    888 
    889 function wp_dashboard_secondary_control() {
    890         wp_dashboard_rss_control( 'dashboard_secondary' );
    891 }
    892 
    893 /**
    894  * Display secondary dashboard RSS widget feed.
    895  *
    896  * @since 2.5.0
    897  *
    898  * @return unknown
    899  */
    900 function wp_dashboard_secondary_output() {
    901         $widgets = get_option( 'dashboard_widget_options' );
    902         @extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
    903         $rss = @fetch_feed( $url );
    904 
    905         if ( is_wp_error($rss) ) {
    906                 if ( is_admin() || current_user_can('manage_options') ) {
    907                         echo '<div class="rss-widget"><p>';
    908                         printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
    909                         echo '</p></div>';
    910                 }
    911         } elseif ( !$rss->get_item_quantity() ) {
    912                 $rss->__destruct();
    913                 unset($rss);
    914                 return false;
    915         } else {
    916                 echo '<div class="rss-widget">';
    917                 wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
    918                 echo '</div>';
    919                 $rss->__destruct();
    920                 unset($rss);
    921         }
    922 }
    923 
    924833function wp_dashboard_plugins() {
    925834        wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
    926835                'http://wordpress.org/plugins/rss/browse/popular/',
  • wp-admin/js/dashboard.js

     
    3030        // These widgets are sometimes populated via ajax
    3131        ajaxWidgets = [
    3232                'dashboard_incoming_links',
    33                 'dashboard_primary',
    34                 'dashboard_secondary',
    3533                'dashboard_plugins'
    3634        ];
    3735
  • wp-admin/css/ie-rtl.css

     
    9595}
    9696
    9797#dashboard_incoming_links ul li,
    98 #dashboard_secondary ul li,
    99 #dashboard_primary ul li,
    10098p.row-actions {
    10199        width: 100%;
    102100}
  • wp-admin/css/colors-fresh.css

     
    552552        border-color: #666;
    553553}
    554554
    555 #dashboard_secondary div.dashboard-widget-content ul li a {
    556         background-color: #f9f9f9;
    557 }
    558 
    559555input.readonly, textarea.readonly {
    560556        background-color: #ddd;
    561557}
  • wp-admin/css/colors-classic.css

     
    550550        border-color: #666;
    551551}
    552552
    553 #dashboard_secondary div.dashboard-widget-content ul li a {
    554         background-color: #f9f9f9;
    555 }
    556 
    557553input.readonly, textarea.readonly {
    558554        background-color: #ddd;
    559555}