Changeset 17766
- Timestamp:
- 04/29/2011 02:46:27 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/dashboard.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r17765 r17766 926 926 */ 927 927 function wp_dashboard_plugins_output() { 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] ); 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/' ); 939 931 940 932 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { … … 1007 999 unset($$feed); 1008 1000 } 1009 set_transient( $transient_key, ob_get_flush() );1010 1001 } 1011 1002 … … 1028 1019 $loading = '<p class="widget-loading">' . __( 'Loading…' ) . '</p>'; 1029 1020 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 1033 1021 if ( empty($check_urls) ) { 1022 $widgets = get_option( 'dashboard_widget_options' ); 1034 1023 if ( empty($widgets[$widget_id]['url']) ) { 1035 1024 echo $loading; 1036 delete_transient( $output_cache );1037 1025 return false; 1038 1026 } … … 1045 1033 if ( ! $cache->load() ) { 1046 1034 echo $loading; 1047 delete_transient( $output_cache );1048 1035 return false; 1049 1036 } 1050 1037 } 1051 1038 1052 if ( false === $cache = get_transient( $output_cache ) ) {1053 echo $loading;1054 return false;1055 }1056 1057 echo $cache;1058 return true;1059 /*1060 1039 if ( $callback && is_callable( $callback ) ) { 1061 1040 $args = array_slice( func_get_args(), 2 ); … … 1065 1044 1066 1045 return true; 1067 */1068 1046 } 1069 1047
Note:
See TracChangeset
for help on using the changeset viewer.