mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-07 08:01:54 +01:00
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.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
103ecdf368
commit
58050466eb
@ -276,11 +276,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if ( isset($meta['id']) ) {
|
||||
$meta['id'] = (int) $meta['id'];
|
||||
$pmeta = get_metadata_by_mid( 'post', $meta['id'] );
|
||||
$meta['value'] = stripslashes_deep( $meta['value'] );
|
||||
if ( isset($meta['key']) ) {
|
||||
$meta['key'] = stripslashes( $meta['key'] );
|
||||
if ( $meta['key'] != $pmeta->meta_key )
|
||||
continue;
|
||||
$meta['value'] = stripslashes_deep( $meta['value'] );
|
||||
if ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) )
|
||||
update_metadata_by_mid( 'post', $meta['id'], $meta['value'] );
|
||||
} elseif ( current_user_can( 'delete_post_meta', $post_id, $pmeta->meta_key ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user