Action hook 'clean_attachment_cache'

in WP Core File wp-includes/post.php at line 7824

View Source

clean_attachment_cache

Action Hook
Description
Fires after the given attachment's cache is cleaned.

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Action
Line Number 7824

Hook Parameters

Type Name Description
int $id Attachment ID.

Usage Examples

Basic Usage
<?php
// Hook into clean_attachment_cache
add_action('clean_attachment_cache', 'my_custom_function', 10, 1);

function my_custom_function($id) {
    // Your custom code here
}

Source Code Context

wp-includes/post.php:7824 - How this hook is used in WordPress core
<?php
7819  	 *
7820  	 * @since 3.0.0
7821  	 *
7822  	 * @param int $id Attachment ID.
7823  	 */
7824  	do_action( 'clean_attachment_cache', $id );
7825  }
7826  
7827  //
7828  // Hooks.
7829  //

PHP Documentation

<?php
/**
	 * Fires after the given attachment's cache is cleaned.
	 *
	 * @since 3.0.0
	 *
	 * @param int $id Attachment ID.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.