WordPress.org

Make WordPress Core

Changeset 36420


Ignore:
Timestamp:
01/29/2016 04:51:11 AM (5 years ago)
Author:
boonebgorges
Message:

Simplify action placement in update_metadata().

By combining a number of foreach loops, we make the code more readable and
potentially faster in the case where many metadata rows are being updated.

Props Shelob9.
Fixes #35652.

File:
1 edited

Legend:

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

    r35725 r36420  
    228228         */
    229229        do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
    230     }
    231 
    232     if ( 'post' == $meta_type ) {
    233         foreach ( $meta_ids as $meta_id ) {
     230
     231        if ( 'post' == $meta_type ) {
    234232            /**
    235233             * Fires immediately before updating a post's metadata.
     
    267265         */
    268266        do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
    269     }
    270 
    271     if ( 'post' == $meta_type ) {
    272         foreach ( $meta_ids as $meta_id ) {
     267
     268        if ( 'post' == $meta_type ) {
    273269            /**
    274270             * Fires immediately after updating a post's metadata.
Note: See TracChangeset for help on using the changeset viewer.