我正在尝试使用javascript和Wordpress REST API更新自定义字段。
我可以使用这个很容易地创建一个新的帖子,并且它工作得很完美:
var post = new wp.api.models.Post( { title: 'This is a test post' } );
post.save();
然而,我需要更新一个帖子自定义字段。我尝试了下面的代码::
var parentId = 91; // the post id
var metaData = new wp.api.collections.PostMeta('', {parent: