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
This commit is contained in:
Drew Jaynes (DrewAPicture) 2014-11-01 04:17:28 +00:00
parent 262150a91e
commit 43b3515501

View File

@ -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 );
}
}