Changeset 13192 for trunk/wp-includes/post.php
- Timestamp:
- 02/18/2010 07:43:35 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13184 r13192 3907 3907 } 3908 3908 3909 /** 3910 * Will clean the attachment in the cache. 3911 * 3912 * Cleaning means delete from the cache. Optionaly will clean the term 3913 * object cache associated with the attachment ID. 3914 * 3915 * This function will not run if $_wp_suspend_cache_invalidation is not empty. See 3916 * wp_suspend_cache_invalidation(). 3917 * 3918 * @package WordPress 3919 * @subpackage Cache 3920 * @since 3.0 3921 * 3922 * @uses do_action() Calls 'clean_attachment_cache' on $id. 3923 * 3924 * @param int $id The attachment ID in the cache to clean 3925 * @param bool $clean_terms optional. Whether to clean terms cache 3926 */ 3927 function clean_attachment_cache($id, $clean_terms = false) { 3928 global $_wp_suspend_cache_invalidation, $wpdb; 3929 3930 if ( !empty($_wp_suspend_cache_invalidation) ) 3931 return; 3932 3933 $id = (int) $id; 3934 3935 wp_cache_delete($id, 'posts'); 3936 wp_cache_delete($id, 'post_meta'); 3937 3938 if ( $clean_terms ) 3939 clean_object_term_cache($id, 'attachment'); 3940 3941 do_action('clean_attachment_cache', $id); 3942 } 3943 3909 3944 // 3910 3945 // Hooks
Note: See TracChangeset
for help on using the changeset viewer.