Changeset 17765
- Timestamp:
- 04/29/2011 02:44:43 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r17764 r17765 926 926 */ 927 927 function wp_dashboard_plugins_output() { 928 $popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' ); 929 $new = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' ); 930 $updated = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/updated/' ); 928 ob_start(); 929 $check_urls = array( 930 'http://wordpress.org/extend/plugins/rss/browse/popular/', 931 'http://wordpress.org/extend/plugins/rss/browse/new/', 932 'http://wordpress.org/extend/plugins/rss/browse/updated/' 933 ); 934 $transient_key = __FUNCTION__ . serialize( '' ) . implode( '|', $check_urls ); 935 936 $popular = fetch_feed( $check_urls[0] ); 937 $new = fetch_feed( $check_urls[1] ); 938 $updated = fetch_feed( $check_urls[2] ); 931 939 932 940 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { … … 999 1007 unset($$feed); 1000 1008 } 1009 set_transient( $transient_key, ob_get_flush() ); 1001 1010 } 1002 1011 … … 1019 1028 $loading = '<p class="widget-loading">' . __( 'Loading…' ) . '</p>'; 1020 1029 1030 $widgets = get_option( 'dashboard_widget_options' ); 1031 $output_cache = 'dashboard_' . md5( $callback . serialize( isset( $widgets[$widget_id] ) ? $widgets[$widget_id] : '' ) . implode( '|', $check_urls ) ); 1032 1021 1033 if ( empty($check_urls) ) { 1022 $widgets = get_option( 'dashboard_widget_options' );1023 1034 if ( empty($widgets[$widget_id]['url']) ) { 1024 1035 echo $loading; 1036 delete_transient( $output_cache ); 1025 1037 return false; 1026 1038 } … … 1033 1045 if ( ! $cache->load() ) { 1034 1046 echo $loading; 1047 delete_transient( $output_cache ); 1035 1048 return false; 1036 1049 } 1037 1050 } 1038 1051 1052 if ( false === $cache = get_transient( $output_cache ) ) { 1053 echo $loading; 1054 return false; 1055 } 1056 1057 echo $cache; 1058 return true; 1059 /* 1039 1060 if ( $callback && is_callable( $callback ) ) { 1040 1061 $args = array_slice( func_get_args(), 2 ); … … 1044 1065 1045 1066 return true; 1067 */ 1046 1068 } 1047 1069 -
trunk/wp-includes/default-widgets.php
r17667 r17765 714 714 715 715 // self-url destruction sequence 716 if ( $url == site_url() || $url == home_url() )716 if ( in_array( untrailingslashit( $url ), array( site_url(), home_url() ) ) ) 717 717 return; 718 718
Note: See TracChangeset
for help on using the changeset viewer.