Wordpress - How to insert custom_fields when inserting the publication via API v2?

Asked

Viewed 17 times

0

I am adding posts on my Wordpress site through the v2 API. The post is being inserted, but the custom_fields are not. Follow my payload below:

$data = [
    'title'         => 'Meu novo titulo 03',
    'status'        => 'publish',
    'meta_data'     => [
        [
            'key' => 'bt_thumb',
            'value' => '111'
        ],
        [
            'key' => 'embed_code',
            'value' => '222'
        ],
    ]
];

It does not error any, simply does not insert the custom_field (custom_fields already exist registered in WP, follows image below). Custom fields existentes no WP

Thanks!

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.