Action hook 'deleted_postmeta'

in WP Core File wp-includes/meta.php at line 545

View Source

deleted_postmeta

Action Hook
Description
Fires immediately after deleting metadata for a post.

Hook Information

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

Hook Parameters

Type Name Description
string[] $meta_ids An array of metadata entry IDs to delete.

Usage Examples

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

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

Source Code Context

wp-includes/meta.php:545 - How this hook is used in WordPress core
<?php
 540  		 *
 541  		 * @since 2.9.0
 542  		 *
 543  		 * @param string[] $meta_ids An array of metadata entry IDs to delete.
 544  		 */
 545  		do_action( 'deleted_postmeta', $meta_ids );
 546  	}
 547  
 548  	return true;
 549  }
 550  

PHP Documentation

<?php
/**
		 * Fires immediately after deleting metadata for a post.
		 *
		 * @since 2.9.0
		 *
		 * @param string[] $meta_ids An array of metadata entry IDs to delete.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/meta.php
Related Hooks

Related hooks will be displayed here in future updates.