Ticket #10337: 10337.12.patch
| File 10337.12.patch, 1.6 KB (added by Viper007Bond, 3 years ago) |
|---|
-
wp-includes/media.php
1038 1038 * @return string The embed HTML on success, otherwise the original URL. 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) ) 1044 1044 return ''; … … 1065 1065 if ( $post_ID ) { 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 1073 1073 if ( '{{unknown}}' === $cache ) … … 1083 1083 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 1092 1089 if ( $html ) … … 1106 1103 $post_metas = get_post_custom_keys( $post_ID ); 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 ); 1112 1110 }
