[wp-trac] [WordPress Trac] #19919: Do not work сustom fields in XML-RPC

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 29 11:12:19 UTC 2012


#19919: Do not work сustom fields in XML-RPC
--------------------------+-----------------------------
 Reporter:  xpert13       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Temporary solution: replace line

 {{{
 } elseif ( current_user_can( 'add_post_meta', $post_id, stripslashes(
 $meta['key'] ) ) ) {
 }}}

 to line

 {{{
 } else {
 }}}

 I think bug is in file /wp-includes/capabilities.php

 {{{
         case 'add_post_meta':
                 $post = get_post( $args[0] );
                 $post_type_object = get_post_type_object( $post->post_type
 );
                 $caps = map_meta_cap( $post_type_object->cap->edit_post,
 $user_id, $post->ID );

                 $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false;

                 if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}"
 ) ) {
                         $allowed = apply_filters(
 "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap,
 $caps );
                         if ( ! $allowed )
                                 $caps[] = $cap;
                 } elseif ( $meta_key && is_protected_meta( $meta_key,
 'post' ) ) {
                         $caps[] = $cap;
                 }
                 break;
 }}}

 Because any custom field could not pass this check.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19919>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list