i create comment in WordPress with REST API. But can't set comment meta. I don't know why, maybe i missing a little bit. So please help.
The code:
// Data
var ajax_data = {
author: user.user_id,
author_email: user.user_email,
content: comment,
parent: parent,
post: post_id,
meta: {
'_crating_speed': rating_speed,
'_crating_price': rating_price,
},
}
// Set header
$.ajaxSetup({
headers: {
'Authorization': "Bearer " + user.token,
}
});
// AJAX
$.post( rest_base + '/comments', ajax_data ).done( function( response ) {
console.log(response);
}).fail( function( xhr, status, error ) {
console.log( error);
}, 'json' );
The meta _crating_speed and _crating_price not inserted to database.