From a929ac44e1cd91ba584e2b52212d4c075f1a557a Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 1 Nov 2014 04:18:23 +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. Built from https://develop.svn.wordpress.org/trunk@30149 git-svn-id: http://core.svn.wordpress.org/trunk@30149 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 74 ++++++++++++++++++++--------------------- wp-includes/version.php | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) 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.