WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 228 | * Fires immediately before updating a post's metadata. |
| 229 | * |
| 230 | * @since 2.9.0 |
| 231 | * |
| 232 | * @param int $meta_id ID of metadata entry to update. |
| 233 | * @param int $object_id Object ID. |
| 234 | * @param string $meta_key Meta key. |
| 235 | * @param mixed $meta_value Meta value. |
| 236 | */ |
| 237 | do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value ); |
| 238 | |
| 239 | $result = $wpdb->update( $table, $data, $where ); |
| 240 | if ( ! $result ) |
| 241 | return false; |
| 242 | |
| 243 | wp_cache_delete($object_id, $meta_type . '_meta'); |
| 244 | |
| 245 | /** |
| 246 | * Fires immediately after updating metadata of a specific type. |
| Line | Code |
| 633 | // Format the where query arguments. |
| 634 | $where = array(); |
| 635 | $where[$id_column] = $meta_id; |
| 636 | |
| 637 | /** This action is documented in wp-includes/meta.php */ |
| 638 | do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); |
| 639 | |
| 640 | if ( 'post' == $meta_type ) { |
| 641 | /** This action is documented in wp-includes/meta.php */ |
| 642 | do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value ); |
| 643 | } |
| 644 | |
| 645 | // Run the update query, all fields in $data are %s, $where is a %d. |
| 646 | $result = $wpdb->update( $table, $data, $where, '%s', '%d' ); |
| 647 | if ( ! $result ) |
| 648 | return false; |
| 649 | |
| 650 | // Clear the caches. |
| 651 | wp_cache_delete($object_id, $meta_type . '_meta'); |