Changeset 12326
- Timestamp:
- 12/06/2009 05:40:36 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r12280 r12326 1039 1039 */ 1040 1040 function shortcode( $attr, $url = '' ) { 1041 global $post , $_wp_using_ext_object_cache;1041 global $post; 1042 1042 1043 1043 if ( empty($url) ) … … 1066 1066 1067 1067 // Check for a cached result (stored in the post meta) 1068 $cachekey = '_oembed_' . md5( $url . implode( '|',$attr ) );1068 $cachekey = '_oembed_' . md5( $url . serialize( $attr ) ); 1069 1069 if ( $this->usecache ) { 1070 $cache = ( $_wp_using_ext_object_cache ) ? wp_cache_get( "{$post_ID}_{$cachekey}", 'oembed' ) :get_post_meta( $post_ID, $cachekey, true );1070 $cache = get_post_meta( $post_ID, $cachekey, true ); 1071 1071 1072 1072 // Failures are cached … … 1084 1084 // Cache the result 1085 1085 $cache = ( $html ) ? $html : '{{unknown}}'; 1086 if ( $_wp_using_ext_object_cache ) 1087 wp_cache_set( "{$post_ID}_{$cachekey}", $cache, 'oembed' ); 1088 else 1089 update_post_meta( $post_ID, $cachekey, $cache ); 1086 update_post_meta( $post_ID, $cachekey, $cache ); 1090 1087 1091 1088 // If there was a result, return it … … 1107 1104 if ( empty($post_metas) ) 1108 1105 return; 1109 foreach( (array) $post_metas as $post_meta_key ) { 1106 1107 foreach( $post_metas as $post_meta_key ) { 1110 1108 if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) ) 1111 1109 delete_post_meta( $post_ID, $post_meta_key );
Note: See TracChangeset
for help on using the changeset viewer.