Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: deleted_{$meta_type}_meta

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
449       * object type (comment, post, term, or user).
450       *
451       * @since 2.9.0
452       *
453       * @param string[] $meta_ids    An array of metadata entry IDs to delete.
454       * @param int      $object_id   ID of the object metadata is for.
455       * @param string   $meta_key    Metadata key.
456       * @param mixed    $_meta_value Metadata value. Serialized if non-scalar.
457       */
458      do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
459
460      // Old-style action.
461      if ( 'post' == $meta_type ) {
462           /**
463            * Fires immediately after deleting metadata for a post.
464            *
465            * @since 2.9.0
466            *
467            * @param string[] $meta_ids An array of metadata entry IDs to delete.
 
Line Code
844           }
845
846           // Run the query, will return true if deleted, false otherwise.
847           $result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) );
848
849           // Clear the caches.
850           wp_cache_delete( $object_id, $meta_type . '_meta' );
851
852           /** This action is documented in wp-includes/meta.php */
853           do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
854
855           // Old-style action.
856           if ( 'post' == $meta_type || 'comment' == $meta_type ) {
857                /**
858                 * Fires immediately after deleting post or comment metadata of a specific type.
859                 *
860                 * The dynamic portion of the hook, `$meta_type`, refers to the meta
861                 * object type (post or comment).
862                 *