Timeline for Create custom post with meta field with AJAX and the Wordpress REST API
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 27, 2019 at 19:15 | comment | added | Sally CJ | See.. you were just starving I guess. :p Anyway, I'm glad you got it working. :) | |
Jun 27, 2019 at 18:46 | vote | accept | GuitarExtended | ||
Jun 27, 2019 at 18:46 | comment | added | GuitarExtended | I tried again with a full stomach, and a walk outside, with the fix you proposed to my original code, and it works ! Thank you very much, that was very helpful. | |
Jun 27, 2019 at 17:59 | comment | added | Sally CJ | Can you update the question with your new code (PHP & JS)? | |
Jun 27, 2019 at 16:41 | comment | added | GuitarExtended | Yes I did, and my custom post type supports those : 'title', 'editor', 'author', 'custom-fields'. I'm very confused. | |
Jun 27, 2019 at 16:23 | comment | added | Sally CJ |
But with your original code in the question, you could just try to use $object->ID instead of $object['id'] in the slug_update_post_meta_cb() .
|
|
Jun 27, 2019 at 16:20 | comment | added | Sally CJ | That's an outdated doc. See here for an updated one. Also, did you read everything here? Make sure your custom post type supports custom fields. | |
Jun 27, 2019 at 16:15 | comment | added | GuitarExtended | Also, I see that the argument "object_subtype isn't listed in the documentation : codex.wordpress.org/Function_Reference/register_meta | |
Jun 27, 2019 at 16:13 | comment | added | GuitarExtended | I tried replacing all the php code I posted above by register_meta, but now I don't even see the custom field in the objects I get in the GET response. Do you know why ? | |
Jun 27, 2019 at 15:09 | history | answered | Sally CJ | CC BY-SA 4.0 |