Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set post_meta when creating a post? #286

Closed
jiji262 opened this issue Jan 17, 2017 · 8 comments
Closed

how to set post_meta when creating a post? #286

jiji262 opened this issue Jan 17, 2017 · 8 comments

Comments

@jiji262
Copy link

jiji262 commented Jan 17, 2017

No description provided.

@emreycolakoglu
Copy link

I'd like to learn this as well. Currently I'm trying like

meta: [{
            key: 'external_thumbnail',
            value: thumbnail
        }]

while creating posts, but no luck

@chattes
Copy link

chattes commented Mar 2, 2017

Even I have the same issue any ideas how can we update Meta Fields?

@kadamwhite
Copy link
Collaborator

How are you registering the meta you wish to update?

@kadamwhite
Copy link
Collaborator

If you use register_rest_field like this: https://github.com/kadamwhite/wp-notebook/blob/master/wp-notebook.php#L62-L81 then you should be able to update the value by passing that key in the response: https://github.com/kadamwhite/wp-notebook/blob/master/src/components/EntryComposer/index.jsx#L49-L53

@kadamwhite
Copy link
Collaborator

If you're using register_meta, it should be something like this (untested):

meta: {
    external_thumbnail: thumbnail
}

@kadamwhite
Copy link
Collaborator

cc @jiji262 / @emreycolakoglu

@jamesjara
Copy link

What about with https://codex.wordpress.org/Function_Reference/update_post_meta I have a big problem using this plugin and framework... documentations is missing or not working.. hard to debugg, thanks for your help

@kadamwhite
Copy link
Collaborator

Closing this as a duplicate of #280 to unify the threads; meta handling is currently our top-priority documentation issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants