Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: updated_{$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
283            * (post, comment, term, user, or any other type with an associated meta table).
284            *
285            * @since 2.9.0
286            *
287            * @param int    $meta_id     ID of updated metadata entry.
288            * @param int    $object_id   ID of the object metadata is for.
289            * @param string $meta_key    Metadata key.
290            * @param mixed  $_meta_value Metadata value. Serialized if non-scalar.
291            */
292           do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
293
294           if ( 'post' === $meta_type ) {
295                /**
296                 * Fires immediately after updating a post's metadata.
297                 *
298                 * @since 2.9.0
299                 *
300                 * @param int    $meta_id    ID of updated metadata entry.
301                 * @param int    $object_id  Post ID.
 
Line Code
868           $result = $wpdb->update( $table, $data, $where, '%s', '%d' );
869           if ( ! $result ) {
870                return false;
871           }
872
873           // Clear the caches.
874           wp_cache_delete( $object_id, $meta_type . '_meta' );
875
876           /** This action is documented in wp-includes/meta.php */
877           do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
878
879           if ( 'post' === $meta_type ) {
880                /** This action is documented in wp-includes/meta.php */
881                do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
882           }
883
884           return true;
885      }
886