diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 5541d12227..c3b2d0ebe6 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -212,35 +212,35 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v $where['meta_value'] = $prev_value; } - /** - * Fires immediately before updating metadata of a specific type. - * - * The dynamic portion of the hook, $meta_type, refers to the meta - * object type (comment, post, or user). - * - * @since 2.9.0 - * - * @param int $meta_id ID of the metadata entry to update. - * @param int $object_id Object ID. - * @param string $meta_key Meta key. - * @param mixed $meta_value Meta value. - */ foreach ( $meta_ids as $meta_id ) { - do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); - } - - if ( 'post' == $meta_type ) { /** - * Fires immediately before updating a post's metadata. + * Fires immediately before updating metadata of a specific type. + * + * The dynamic portion of the hook, $meta_type, refers to the meta + * object type (comment, post, or user). * * @since 2.9.0 * - * @param int $meta_id ID of metadata entry to update. + * @param int $meta_id ID of the metadata entry to update. * @param int $object_id Object ID. * @param string $meta_key Meta key. * @param mixed $meta_value Meta value. */ + do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); + } + + if ( 'post' == $meta_type ) { foreach ( $meta_ids as $meta_id ) { + /** + * Fires immediately before updating a post's metadata. + * + * @since 2.9.0 + * + * @param int $meta_id ID of metadata entry to update. + * @param int $object_id Object ID. + * @param string $meta_key Meta key. + * @param mixed $meta_value Meta value. + */ do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value ); } } @@ -251,26 +251,12 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v wp_cache_delete($object_id, $meta_type . '_meta'); - /** - * Fires immediately after updating metadata of a specific type. - * - * The dynamic portion of the hook, $meta_type, refers to the meta - * object type (comment, post, or user). - * - * @since 2.9.0 - * - * @param int $meta_id ID of updated metadata entry. - * @param int $object_id Object ID. - * @param string $meta_key Meta key. - * @param mixed $meta_value Meta value. - */ foreach ( $meta_ids as $meta_id ) { - do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); - } - - if ( 'post' == $meta_type ) { /** - * Fires immediately after updating a post's metadata. + * Fires immediately after updating metadata of a specific type. + * + * The dynamic portion of the hook, $meta_type, refers to the meta + * object type (comment, post, or user). * * @since 2.9.0 * @@ -279,7 +265,21 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v * @param string $meta_key Meta key. * @param mixed $meta_value Meta value. */ + do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); + } + + if ( 'post' == $meta_type ) { foreach ( $meta_ids as $meta_id ) { + /** + * Fires immediately after updating a post's metadata. + * + * @since 2.9.0 + * + * @param int $meta_id ID of updated metadata entry. + * @param int $object_id Object ID. + * @param string $meta_key Meta key. + * @param mixed $meta_value Meta value. + */ do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 05a5bc2fbd..72d7badf90 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30148'; +$wp_version = '4.1-alpha-30149'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.