Make WordPress Core

Changeset 30149


Ignore:
Timestamp:
11/01/2014 04:17:28 AM (10 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/meta.php

    r30140 r30149  
    213213    }
    214214
    215     /**
    216      * Fires immediately before updating metadata of a specific type.
    217      *
    218      * The dynamic portion of the hook, $meta_type, refers to the meta
    219      * object type (comment, post, or user).
    220      *
    221      * @since 2.9.0
    222      *
    223      * @param int    $meta_id    ID of the metadata entry to update.
    224      * @param int    $object_id  Object ID.
    225      * @param string $meta_key   Meta key.
    226      * @param mixed  $meta_value Meta value.
    227      */
    228215    foreach ( $meta_ids as $meta_id ) {
    229         do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
    230     }
    231 
    232     if ( 'post' == $meta_type ) {
    233216        /**
    234          * Fires immediately before updating a post's metadata.
     217         * Fires immediately before updating metadata of a specific type.
     218         *
     219         * The dynamic portion of the hook, $meta_type, refers to the meta
     220         * object type (comment, post, or user).
    235221         *
    236222         * @since 2.9.0
    237223         *
    238          * @param int    $meta_id    ID of metadata entry to update.
     224         * @param int    $meta_id    ID of the metadata entry to update.
    239225         * @param int    $object_id  Object ID.
    240226         * @param string $meta_key   Meta key.
    241227         * @param mixed  $meta_value Meta value.
    242228         */
     229        do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
     230    }
     231
     232    if ( 'post' == $meta_type ) {
    243233        foreach ( $meta_ids as $meta_id ) {
     234            /**
     235             * Fires immediately before updating a post's metadata.
     236             *
     237             * @since 2.9.0
     238             *
     239             * @param int    $meta_id    ID of metadata entry to update.
     240             * @param int    $object_id  Object ID.
     241             * @param string $meta_key   Meta key.
     242             * @param mixed  $meta_value Meta value.
     243             */
    244244            do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
    245245        }
     
    252252    wp_cache_delete($object_id, $meta_type . '_meta');
    253253
    254     /**
    255      * Fires immediately after updating metadata of a specific type.
    256      *
    257      * The dynamic portion of the hook, $meta_type, refers to the meta
    258      * object type (comment, post, or user).
    259      *
    260      * @since 2.9.0
    261      *
    262      * @param int    $meta_id    ID of updated metadata entry.
    263      * @param int    $object_id  Object ID.
    264      * @param string $meta_key   Meta key.
    265      * @param mixed  $meta_value Meta value.
    266      */
    267254    foreach ( $meta_ids as $meta_id ) {
    268         do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
    269     }
    270 
    271     if ( 'post' == $meta_type ) {
    272255        /**
    273          * Fires immediately after updating a post's metadata.
     256         * Fires immediately after updating metadata of a specific type.
     257         *
     258         * The dynamic portion of the hook, $meta_type, refers to the meta
     259         * object type (comment, post, or user).
    274260         *
    275261         * @since 2.9.0
     
    280266         * @param mixed  $meta_value Meta value.
    281267         */
     268        do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
     269    }
     270
     271    if ( 'post' == $meta_type ) {
    282272        foreach ( $meta_ids as $meta_id ) {
     273            /**
     274             * Fires immediately after updating a post's metadata.
     275             *
     276             * @since 2.9.0
     277             *
     278             * @param int    $meta_id    ID of updated metadata entry.
     279             * @param int    $object_id  Object ID.
     280             * @param string $meta_key   Meta key.
     281             * @param mixed  $meta_value Meta value.
     282             */
    283283            do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
    284284        }
Note: See TracChangeset for help on using the changeset viewer.