Make WordPress Core


Ignore:
Timestamp:
04/11/2012 08:02:39 PM (12 years ago)
Author:
nacin
Message:

Use the metadata API rather than raw queries and direct do_action calls. see #20417.

File:
1 edited

Legend:

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

    r20287 r20435  
    224224    do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
    225225
     226    // Old-style action.
    226227    if ( 'post' == $meta_type )
    227228        do_action( 'delete_postmeta', $meta_ids );
     
    244245    do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
    245246
     247    // Old-style action.
    246248    if ( 'post' == $meta_type )
    247249        do_action( 'deleted_postmeta', $meta_ids );
     
    486488        do_action( "delete_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
    487489
    488         if ( 'post' == $meta_type )
    489             do_action( 'delete_postmeta', $meta_id );
     490        // Old-style action.
     491        if ( 'post' == $meta_type || 'comment' == $meta_type )
     492            do_action( "delete_{$meta_type}meta", $meta_id );
    490493
    491494        // Run the query, will return true if deleted, false otherwise
     
    497500        do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
    498501
    499         if ( 'post' == $meta_type )
    500             do_action( 'deleted_postmeta', $meta_id );
     502        // Old-style action.
     503        if ( 'post' == $meta_type || 'comment' == $meta_type )
     504            do_action( "deleted_{$meta_type}meta", $meta_id );
    501505
    502506        return $result;
Note: See TracChangeset for help on using the changeset viewer.