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
861           $result = $wpdb->update( $table, $data, $where, '%s', '%d' );
862           if ( ! $result ) {
863                return false;
864           }
865
866           // Clear the caches.
867           wp_cache_delete( $object_id, $meta_type . '_meta' );
868
869           /** This action is documented in wp-includes/meta.php */
870           do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
871
872           if ( 'post' === $meta_type ) {
873                /** This action is documented in wp-includes/meta.php */
874                do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
875           }
876
877           return true;
878      }
879