Make WordPress Core

Changeset 20583


Ignore:
Timestamp:
04/25/2012 02:26:31 PM (12 years ago)
Author:
nacin
Message:

Do not check for a meta value in XML-RPC set_custom_fields unless we know we are editing a key. Prevents a notice when a custom field is being deleted. props scott.gonzalez. fixes #20543.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r20576 r20583  
    277277                $meta['id'] = (int) $meta['id'];
    278278                $pmeta = get_metadata_by_mid( 'post', $meta['id'] );
    279                 $meta['value'] = stripslashes_deep( $meta['value'] );
    280279                if ( isset($meta['key']) ) {
    281280                    $meta['key'] = stripslashes( $meta['key'] );
    282281                    if ( $meta['key'] != $pmeta->meta_key )
    283282                        continue;
     283                    $meta['value'] = stripslashes_deep( $meta['value'] );
    284284                    if ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) )
    285285                        update_metadata_by_mid( 'post', $meta['id'], $meta['value'] );
Note: See TracChangeset for help on using the changeset viewer.