Hi,
i want create post with rpc. My params array for rpc looks like this and works fine.
$params = array(
0,
‘user’,
‘password’,
array(
‘post_type’ => ‘article’,
‘post_status’ => ‘publish’,
‘post_title’ => ‘nice rpc’,
‘post_author’ => 1,
‘post_content’ => ‘funny :D’,
‘post_excerpt’ => ‘lol’,
‘custom_fields’ => array(
array(‘key’ => ‘foobar’, ‘value’ => ‘nice’),
array(‘key’ => ‘_foobar’, ‘value’ => ‘field_532bf2274eae2’),
),
);
But the hidden custom field _foobar isn’t created. Why? I search the reason in wordpress code and found out, that in the function “set_custom_fields($post_id, $fields)” the underscore meta key don’t pass this line “elseif ( current_user_can( ‘add_post_meta’, $post_id, wp_unslash( $meta[‘key’] ) ) )”. Why?