From 43b35155010f76bdc76cf9fae84afe92745685e9 Mon Sep 17 00:00:00 2001 From: "Drew Jaynes (DrewAPicture)" Date: Sat, 1 Nov 2014 04:17:28 +0000 Subject: [PATCH] Relocate hook docs so they directly precede the hook lines moved into foreach statements in [30140]. It's necessary for hook docs to directly precede hook lines so the parser can correctly match them up. This change relocates hook docs for `update_{$meta_type}_meta`, `update_postmeta`, `updated_{$meta_type}_meta`, and `updated_postmeta`. Fixes #11683. git-svn-id: https://develop.svn.wordpress.org/trunk@30149 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/meta.php | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 5541d12227..c3b2d0ebe6 100644 --- a/src/wp-includes/meta.php +++ b/src/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 ); } }