Add a guide for "how to work with meta"
See original GitHub issueHi, i tried to update post meta, when i created posts, but nothing happened
It’s possible with node-wpapi?
wp.song().create({ title: '1', content: 'Your post content', status: 'publish', meta: {key: 'youtube', value: '12'}, }).then(function( response ) { console.log( response.id ); })
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
What is Learning on Workplace and how do I use it? - Facebook
You may need to click See All below Groups section first. Click More, then click Learning. Click Start a Guide and add a...
Read more >The Workplace New User Guide
You can also add a short bio to tell your coworkers a little more about ... Check out this guide for more tips...
Read more >How to Use Meta Business Suite - Social Media Examiner
From the All Tools menu, select File Manager. Then click the Create Folder button to get started. Give the folder a name and...
Read more >META General User Guide
how to use the search screens, see the Searching Curriculum section of this guide. Profile Management. The first time you log in, you...
Read more >Getting started with Meta Quest 2
If you're new to Meta Quest, a Meta account is required to use your device, apps and the app store. You'll be asked...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When you create/update post, you pass
meta
object, for example:On the server side, you must use
register_meta()
. If you are using custom post type, the post type must havecustom-fields
support (see documentation for$args['supports']
ofregister_post_type()
. That is documented for REST API.But if you are using
meta
with custom role, your role should also haveedit_post_meta
(anddelete_post_meta
if you are deleting) capability. See code forWP_REST_Meta_Fields::update_meta_value()
andWP_REST_Meta_Fields::delete_meta_value()
. I haven’t seen that this is documented anywhere so I figured it out during debugging.Messed with the same problem, being total noob in wordpress infrastructure. Solved by putting
into functions.php of theme. This unlocked me: