Ticket #19239: 19239.5.diff
File 19239.5.diff, 25.6 KB (added by , 12 years ago) |
---|
-
wp-includes/default-widgets.php
823 823 * @param array $args Widget arguments. 824 824 */ 825 825 function wp_widget_rss_output( $rss, $args = array() ) { 826 if ( is_string( $rss ) ) { 827 $rss = fetch_feed($rss); 828 } elseif ( is_array($rss) && isset($rss['url']) ) { 829 $args = $rss; 830 $rss = fetch_feed($rss['url']); 831 } elseif ( !is_object($rss) ) { 832 return; 833 } 826 827 // Shows plugins plus link to install them 828 if ( isset( $args['type'] ) && 'plugins' == $args['type'] ) { 834 829 835 if ( is_wp_error($rss) ) { 836 if ( is_admin() || current_user_can('manage_options') ) 837 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>'; 838 return; 839 } 840 841 $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0 ); 842 $args = wp_parse_args( $args, $default_args ); 843 extract( $args, EXTR_SKIP ); 844 845 $items = (int) $items; 846 if ( $items < 1 || 20 < $items ) 847 $items = 10; 848 $show_summary = (int) $show_summary; 849 $show_author = (int) $show_author; 850 $show_date = (int) $show_date; 851 852 if ( !$rss->get_item_quantity() ) { 853 echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>'; 854 $rss->__destruct(); 855 unset($rss); 856 return; 857 } 858 859 echo '<ul>'; 860 foreach ( $rss->get_items(0, $items) as $item ) { 861 $link = $item->get_link(); 862 while ( stristr($link, 'http') != $link ) 863 $link = substr($link, 1); 864 $link = esc_url(strip_tags($link)); 865 $title = esc_attr(strip_tags($item->get_title())); 866 if ( empty($title) ) 867 $title = __('Untitled'); 868 869 $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); 870 $excerpt = wp_html_excerpt( $desc, 360 ); 871 872 // Append ellipsis. Change existing [...] to […]. 873 if ( '[...]' == substr( $excerpt, -5 ) ) 874 $excerpt = substr( $excerpt, 0, -5 ) . '[…]'; 875 elseif ( '[…]' != substr( $excerpt, -10 ) && $desc != $excerpt ) 876 $excerpt .= ' […]'; 877 878 $excerpt = esc_html( $excerpt ); 879 880 if ( $show_summary ) { 881 $summary = "<div class='rssSummary'>$excerpt</div>"; 882 } else { 883 $summary = ''; 830 $popular = fetch_feed( $args['url']['popular'] ); 831 $new = fetch_feed( $args['url']['new'] ); 832 833 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { 834 $plugin_slugs = array_keys( get_plugins() ); 835 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); 884 836 } 885 886 $date = ''; 887 if ( $show_date ) { 888 $date = $item->get_date( 'U' ); 889 890 if ( $date ) { 891 $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>'; 837 838 echo '<ul>'; 839 840 foreach ( array( 'popular' => __('Popular Plugin'), 'new' => __('Newest Plugin') ) as $feed => $label ) { 841 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() ) 842 continue; 843 844 $items = $$feed->get_items(0, 5); 845 846 // Pick a random, non-installed plugin 847 while ( true ) { 848 // Abort this foreach loop iteration if there's no plugins left of this type 849 if ( 0 == count($items) ) 850 continue 2; 851 852 $item_key = array_rand($items); 853 $item = $items[$item_key]; 854 855 list($link, $frag) = explode( '#', $item->get_link() ); 856 857 $link = esc_url($link); 858 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) ) 859 $slug = $matches[1]; 860 else { 861 unset( $items[$item_key] ); 862 continue; 863 } 864 865 // Is this random plugin's slug already installed? If so, try again. 866 reset( $plugin_slugs ); 867 foreach ( $plugin_slugs as $plugin_slug ) { 868 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { 869 unset( $items[$item_key] ); 870 continue 2; 871 } 872 } 873 874 // If we get to this point, then the random plugin isn't installed and we can stop the while(). 875 break; 892 876 } 877 878 // Eliminate some common badly formed plugin descriptions 879 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) 880 unset($items[$item_key]); 881 882 if ( !isset($items[$item_key]) ) 883 continue; 884 885 $title = esc_html( $item->get_title() ); 886 887 $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) ); 888 889 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&TB_iframe=true&width=600&height=800'; 890 891 echo "<li><span>$label:</span> <a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span></li>"; 892 893 $$feed->__destruct(); 894 unset($$feed); 893 895 } 896 897 echo '</ul>'; 898 899 } else { // Shows all other RSS feeds 894 900 895 $author = ''; 896 if ( $show_author ) { 897 $author = $item->get_author(); 898 if ( is_object($author) ) { 899 $author = $author->get_name(); 900 $author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>'; 901 if ( is_string( $rss ) ) { 902 $rss = fetch_feed($rss); 903 } elseif ( is_array($rss) && isset($rss['url']) ) { 904 $args = $rss; 905 $rss = fetch_feed($rss['url']); 906 } elseif ( !is_object($rss) ) { 907 return; 908 } 909 910 if ( is_wp_error($rss) ) { 911 if ( is_admin() || current_user_can('manage_options') ) 912 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>'; 913 return; 914 } 915 916 $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0 ); 917 $args = wp_parse_args( $args, $default_args ); 918 extract( $args, EXTR_SKIP ); 919 920 $items = (int) $items; 921 if ( $items < 1 || 20 < $items ) 922 $items = 10; 923 $show_summary = (int) $show_summary; 924 $show_author = (int) $show_author; 925 $show_date = (int) $show_date; 926 927 if ( !$rss->get_item_quantity() ) { 928 echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>'; 929 $rss->__destruct(); 930 unset($rss); 931 return; 932 } 933 934 echo '<ul>'; 935 936 foreach ( $rss->get_items(0, $items) as $item ) { 937 $link = $item->get_link(); 938 while ( stristr($link, 'http') != $link ) 939 $link = substr($link, 1); 940 $link = esc_url(strip_tags($link)); 941 $title = esc_attr(strip_tags($item->get_title())); 942 if ( empty($title) ) 943 $title = __('Untitled'); 944 945 $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); 946 $excerpt = wp_html_excerpt( $desc, 160 ); 947 948 // Append ellipsis. Change existing [...] to […]. 949 if ( '[...]' == substr( $excerpt, -5 ) ) 950 $excerpt = substr( $excerpt, 0, -5 ) . '[…]'; 951 elseif ( '[…]' != substr( $excerpt, -10 ) && $desc != $excerpt ) 952 $excerpt .= ' […]'; 953 954 $excerpt = esc_html( $excerpt ); 955 956 if ( $show_summary ) { 957 $summary = "<div class='rssSummary'>$excerpt</div>"; 958 } else { 959 $summary = ''; 901 960 } 961 962 $date = ''; 963 if ( $show_date ) { 964 $date = $item->get_date( 'U' ); 965 966 if ( $date ) { 967 $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>'; 968 } 969 } 970 971 $author = ''; 972 if ( $show_author ) { 973 $author = $item->get_author(); 974 if ( is_object($author) ) { 975 $author = $author->get_name(); 976 $author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>'; 977 } 978 } 979 980 if ( $link == '' ) { 981 echo "<li>$title{$date}{$summary}{$author}</li>"; 982 } else { 983 echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>"; 984 } 902 985 } 903 904 if ( $link == '' ) { 905 echo "<li>$title{$date}{$summary}{$author}</li>"; 906 } else { 907 echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>"; 908 } 986 $rss->__destruct(); 987 unset($rss); 988 989 echo '</ul>'; 909 990 } 910 echo '</ul>';911 $rss->__destruct();912 unset($rss);913 991 } 914 992 915 993 /** … … 944 1022 if ( !empty($error) ) 945 1023 echo '<p class="widget-error"><strong>' . sprintf( __('RSS Error: %s'), $error) . '</strong></p>'; 946 1024 947 if ( $inputs['url'] ) :1025 if ( $inputs['url'] && is_string( $args['url'] ) ) : 948 1026 ?> 949 1027 <p><label for="rss-url-<?php echo $number; ?>"><?php _e('Enter the RSS feed URL here:'); ?></label> 950 1028 <input class="widefat" id="rss-url-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][url]" type="text" value="<?php echo $url; ?>" /></p> -
wp-admin/includes/ajax-actions.php
209 209 case 'dashboard_incoming_links' : 210 210 wp_dashboard_incoming_links(); 211 211 break; 212 case 'dashboard_ primary' :213 wp_dashboard_ primary();212 case 'dashboard_rss' : 213 wp_dashboard_rss(); 214 214 break; 215 case 'dashboard_secondary' :216 wp_dashboard_secondary();217 break;218 case 'dashboard_plugins' :219 wp_dashboard_plugins();220 break;221 215 } 222 216 wp_die(); 223 217 } -
wp-admin/includes/dashboard.php
70 70 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); 71 71 } 72 72 73 // WP Plugins Widget74 if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )75 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );76 77 73 // QuickPress Widget 78 74 if ( is_blog_admin() && current_user_can('edit_posts') ) 79 75 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); … … 81 77 // Recent Drafts 82 78 if ( is_blog_admin() && current_user_can('edit_posts') ) 83 79 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); 80 81 // RSS Widget 82 wp_add_dashboard_widget( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'wp_dashboard_rss_feed_control' ); 84 83 85 // Primary feed (Dev Blog) Widget86 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) Widget101 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 115 84 // Hook to register new widgets 116 85 // Filter widget order 117 86 if ( is_network_admin() ) { … … 163 132 } 164 133 165 134 if ( is_blog_admin () ) 166 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');135 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts','dashboard_rss'); 167 136 else if (is_network_admin() ) 168 $side_widgets = array('dashboard_ primary', 'dashboard_secondary');137 $side_widgets = array('dashboard_rss'); 169 138 else 170 139 $side_widgets = array(); 171 140 … … 856 825 unset($rss); 857 826 } 858 827 828 function wp_dashboard_rss_feed_control() { 829 wp_dashboard_rss_control( 'dashboard_rss' ); 830 } 831 859 832 function wp_dashboard_incoming_links_control() { 860 833 wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ); 861 834 } 862 835 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 836 /** 872 837 * Display primary dashboard RSS widget feed. 873 838 * … … 875 840 * 876 841 * @param string $widget_id 877 842 */ 878 function wp_dashboard_rss_output( $widget_id) {843 function wp_dashboard_rss_output() { 879 844 $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 { 845 846 foreach( $widgets['dashboard_rss'] as $type => $args ) { 847 $args['type'] = $type; 916 848 echo '<div class="rss-widget">'; 917 wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] ); 918 echo '</div>'; 919 $rss->__destruct(); 920 unset($rss); 849 wp_widget_rss_output( $args['url'], $args ); 850 echo "</div>"; 921 851 } 922 852 } 923 853 924 function wp_dashboard_plugins() { 925 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array( 926 'http://wordpress.org/plugins/rss/browse/popular/', 927 'http://wordpress.org/plugins/rss/browse/new/' 928 ) ); 929 } 930 931 /** 932 * Display plugins most popular, newest plugins, and recently updated widget text. 933 * 934 * @since 2.5.0 935 */ 936 function wp_dashboard_plugins_output() { 937 $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' ); 938 $new = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' ); 939 940 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { 941 $plugin_slugs = array_keys( get_plugins() ); 942 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); 854 /** 855 * Display (cached) dashboard RSS widget 856 * 857 * @since 3.7.0 858 */ 859 function wp_dashboard_rss() { 860 $default_feeds = array( 861 'news' => array( 862 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ), 863 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ), 864 'title' => '', 865 'items' => 1, 866 'show_summary' => 1, 867 'show_author' => 0, 868 'show_date' => 1, 869 ), 870 'planet' => array( 871 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 872 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 873 'title' => '', 874 'items' => 3, 875 'show_summary' => 0, 876 'show_author' => 0, 877 'show_date' => 0, 878 ), 879 'plugins' => array( 880 'link' => '', 881 'url' => array( 882 'popular' => 'http://wordpress.org/plugins/rss/browse/popular/', 883 'new' => 'http://wordpress.org/plugins/rss/browse/new/' 884 ), 885 'title' => '', 886 'items' => 1, 887 'show_summary' => 0, 888 'show_author' => 0, 889 'show_date' => 0, 890 ) 891 ); 892 893 $widget_options = get_option( 'dashboard_widget_options' ); 894 895 if ( !$widget_options || !is_array($widget_options) ) 896 $widget_options = array(); 897 898 if ( ! isset( $widget_options['dashboard_rss'] ) ) { 899 $widget_options['dashboard_rss'] = $default_feeds; 900 update_option( 'dashboard_widget_options', $widget_options ); 943 901 } 944 945 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) { 946 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() ) 947 continue; 948 949 $items = $$feed->get_items(0, 5); 950 951 // Pick a random, non-installed plugin 952 while ( true ) { 953 // Abort this foreach loop iteration if there's no plugins left of this type 954 if ( 0 == count($items) ) 955 continue 2; 956 957 $item_key = array_rand($items); 958 $item = $items[$item_key]; 959 960 list($link, $frag) = explode( '#', $item->get_link() ); 961 962 $link = esc_url($link); 963 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) ) 964 $slug = $matches[1]; 965 else { 966 unset( $items[$item_key] ); 967 continue; 968 } 969 970 // Is this random plugin's slug already installed? If so, try again. 971 reset( $plugin_slugs ); 972 foreach ( $plugin_slugs as $plugin_slug ) { 973 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { 974 unset( $items[$item_key] ); 975 continue 2; 976 } 977 } 978 979 // If we get to this point, then the random plugin isn't installed and we can stop the while(). 980 break; 981 } 982 983 // Eliminate some common badly formed plugin descriptions 984 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) 985 unset($items[$item_key]); 986 987 if ( !isset($items[$item_key]) ) 988 continue; 989 990 $title = esc_html( $item->get_title() ); 991 992 $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) ); 993 994 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . 995 '&TB_iframe=true&width=600&height=800'; 996 997 echo "<h4>$label</h4>\n"; 998 echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n"; 999 echo "<p>$description</p>\n"; 1000 1001 $$feed->__destruct(); 1002 unset($$feed); 902 903 foreach( $default_feeds as $key => $value ) { 904 $default_urls[] = $value['url']; 1003 905 } 906 907 wp_dashboard_cached_rss_widget( 'dashboard_rss', 'wp_dashboard_rss_output', $default_urls ); 1004 908 } 1005 909 1006 910 /** … … 1089 993 if ( !isset($widget_options[$widget_id]) ) 1090 994 $widget_options[$widget_id] = array(); 1091 995 1092 $number = 1; // Hack to use wp_widget_rss_form() 1093 $widget_options[$widget_id]['number'] = $number; 996 if ( isset( $widget_options[$widget_id]['url'] ) ) { 997 // Single feed 998 $widget_options[$widget_id]['number'] = 1; 999 wp_dashboard_rss_form_control( $widget_options[$widget_id], $form_inputs ); 1000 } else { 1001 // Multiple feeds 1002 foreach ( $widget_options[$widget_id] as $name => $options ) { 1003 $options['number'] = $name; 1004 1005 if ( 'dashboard_rss' == $widget_id ) 1006 $form_inputs = array( 'title' => false, 'show_summary' => false, 'show_author' => false, 'show_date' => false, 'items' => false ); 1007 1008 wp_dashboard_rss_form_control( $options, $form_inputs ); 1009 } 1010 } 1094 1011 1095 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) { 1096 $_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] ); 1097 $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] ); 1098 $widget_options[$widget_id]['number'] = $number; 1099 // title is optional. If black, fill it if possible 1100 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 1101 $rss = fetch_feed($widget_options[$widget_id]['url']); 1102 if ( is_wp_error($rss) ) { 1103 $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed')); 1104 } else { 1105 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); 1106 $rss->__destruct(); 1107 unset($rss); 1012 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss']) ) { 1013 1014 if ( isset( $widget_options[$widget_id]['url'] ) ) { 1015 // Single feed 1016 $_POST['widget-rss'][1] = wp_unslash( $_POST['widget-rss'][1] ); 1017 $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][1] ); 1018 } else { 1019 // Multiple feeds 1020 $_POST['widget-rss'] = wp_unslash( $_POST['widget-rss'] ); 1021 foreach ( $widget_options[$widget_id] as $name => $options ) { 1022 $widget_options[$widget_id][$name] = wp_widget_rss_process( $_POST['widget-rss'][$name] ); 1108 1023 } 1109 1024 } 1110 1025 update_option( 'dashboard_widget_options', $widget_options ); 1111 1026 $cache_key = 'dash_' . md5( $widget_id ); 1112 1027 delete_transient( $cache_key ); 1113 1028 } 1029 } 1114 1030 1115 wp_widget_rss_form( $widget_options[$widget_id], $form_inputs ); 1031 function wp_dashboard_rss_form_control( $options, $form_inputs ) { 1032 wp_widget_rss_form( $options, $form_inputs ); 1116 1033 } 1117 1034 1118 1035 /** -
wp-admin/js/dashboard.js
30 30 // These widgets are sometimes populated via ajax 31 31 ajaxWidgets = [ 32 32 'dashboard_incoming_links', 33 'dashboard_primary', 34 'dashboard_secondary', 35 'dashboard_plugins' 33 'dashboard_rss', 36 34 ]; 37 35 38 36 ajaxPopulateWidgets = function(el) { -
wp-admin/js/plugin-install.js
27 27 28 28 $(window).resize(function(){ tb_position(); }); 29 29 30 $(' #dashboard_plugins,.plugins').on( 'click', 'a.thickbox', function() {30 $('.plugins').on( 'click', 'a.thickbox', function() { 31 31 tb_click.call(this); 32 32 33 33 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); -
wp-admin/css/ie-rtl.css
86 86 margin-right: 335px !important; 87 87 } 88 88 89 #dashboard_plugins {90 direction: ltr;91 }92 93 #dashboard_plugins h3.hndle {94 direction: rtl;95 }96 97 89 #dashboard_incoming_links ul li, 98 #dashboard_secondary ul li,99 #dashboard_primary ul li,100 90 p.row-actions { 101 91 width: 100%; 102 92 } -
wp-admin/css/colors-fresh.css
552 552 border-color: #666; 553 553 } 554 554 555 #dashboard_secondary div.dashboard-widget-content ul li a {556 background-color: #f9f9f9;557 }558 559 555 input.readonly, textarea.readonly { 560 556 background-color: #ddd; 561 557 } -
wp-admin/css/wp-admin-rtl.css
2130 2130 #dashboard_right_now p.sub, 2131 2131 #dashboard-widgets h4, 2132 2132 a.rsswidget, 2133 #dashboard_plugins h4,2134 #dashboard_plugins h5,2135 2133 #dashboard_recent_comments .comment-meta .approve, 2136 2134 #dashboard_right_now td.b, 2137 2135 #dashboard_right_now .versions a { … … 2167 2165 clear: left; 2168 2166 } 2169 2167 2170 #dashboard_plugins .inside span {2171 padding-left: 0;2172 padding-right: 5px;2173 }2174 2175 2168 #dashboard-widgets h3 .postbox-title-action { 2176 2169 right: auto; 2177 2170 left: 10px; … … 2903 2896 .locale-he-il #dashboard_right_now p.sub, 2904 2897 .locale-he-il #dashboard-widgets h4, 2905 2898 .locale-he-il a.rsswidget, 2906 .locale-he-il #dashboard_plugins h4,2907 .locale-he-il #dashboard_plugins h5,2908 2899 .locale-he-il #dashboard_recent_comments .comment-meta .approve, 2909 2900 .locale-he-il #dashboard_right_now td.b, 2910 2901 .locale-he-il #dashboard_right_now .versions a, -
wp-admin/css/wp-admin.css
763 763 764 764 div.sidebar-name h3, 765 765 #menu-management .nav-tab, 766 #dashboard_plugins h5,767 a.rsswidget,768 766 #dashboard_right_now td.b, 769 767 #dashboard-widgets h4, 770 768 .tool-box .title, … … 6786 6784 padding: 0; 6787 6785 } 6788 6786 6787 .rss-widget { 6788 border-bottom: 1px solid #eee; 6789 margin-bottom: 13px; 6790 } 6791 6792 .rss-widget:last-child { 6793 border-bottom: none; 6794 margin-bottom: 0; 6795 } 6796 6789 6797 /* Right Now */ 6790 6798 #dashboard_right_now p.sub, 6791 6799 #dashboard_right_now .table, #dashboard_right_now .versions { … … 7087 7095 margin-bottom: 12px; 7088 7096 } 7089 7097 7090 .rss-widget span .rss-date{7098 .rss-widget span { 7091 7099 color: #999; 7092 7100 font-size: 12px; 7101 } 7102 7103 .rss-widget span.rss-date { 7093 7104 margin-left: 3px; 7094 7105 } 7095 7106 … … 7104 7115 content: '\2014'; 7105 7116 } 7106 7117 7107 /* Plugins */7108 #dashboard_plugins h4 {7109 line-height: 1.7em;7110 }7111 7112 #dashboard_plugins h5 {7113 font-weight: normal;7114 font-size: 13px;7115 margin: 0;7116 display: inline;7117 line-height: 1.4em;7118 }7119 7120 #dashboard_plugins h5 a {7121 line-height: 1.4em;7122 }7123 7124 #dashboard_plugins .inside span {7125 font-size: 12px;7126 padding-left: 5px;7127 }7128 7129 #dashboard_plugins p {7130 margin: 0.3em 0 1.4em;7131 line-height: 1.4em;7132 }7133 7134 7118 .dashboard-comment-wrap { 7135 7119 overflow: hidden; 7136 7120 word-wrap: break-word; -
wp-admin/css/colors-classic.css
550 550 border-color: #666; 551 551 } 552 552 553 #dashboard_secondary div.dashboard-widget-content ul li a {554 background-color: #f9f9f9;555 }556 557 553 input.readonly, textarea.readonly { 558 554 background-color: #ddd; 559 555 }