Has anyone got this to work well with Carbon Fields and if so how?
Thanks
(Goes without saying this is a fantastic plugin)
]]>Hello,
I’m trying to make an external function that “writes” some information into my wordpress. When I make a CURL with the POST, the only fields that it writes are the standar ones, not the custom fields that appears on “rest_api_enabler”.
It’s possible to make a POST with custom fields with this plugin?
Thanks in advance.
PS: my json is like this:
{
'title': Test!',
'content': 'Hello World',
'status': 'publish',
'author': 3,
'featured_media': 21,
'sticky': true,
'comment_status': 'closed',
'rest_api_enabler': {
'movies_length': '94',
'event_country': 'USA',
'event_year': '2016',
'event_imdb_rating': '5.9'
}
}
]]>
Hi,
i am very new to wp development and having some problem using rest api…
our team has the job finding website and i am trying get data from the site using rest api..
i use ‘Rest API (version 2)’ and ‘Rest Api Enabler’…
i following your description and check all post meta data in setting..
our site has ‘posts’,’job listings’,’resume’,’companies’ and etc…
i try to get the data from “https://oursitename/wp-json/wp/v2/all-job”..
which return the data not including most of the data in “job listings” such as location, job categories, company and type.. i have enable all those field in setting…
Could you please give me a advice or steps of how to make it right?
Thanks and really appreciate your support…
Hi Mickey,
i add a field from Wp Job Manager called geolocation_city (is a meta/custom field) and it appears in the rest api, but appears in [] like this:
...
"comment_status": "open",
"ping_status": "open",
"geolocation_city": ["Oeiras"],
...
i can read “comment_status” and “ping_status”, but cant read “geolocation_city” because is a array ?
how do I read the “geolocation_city” data ?
]]>When activated, the file upload function via /media endpoint will not work. The wp_posts record is created and returned but the file itself will not be written to disk. It seems that the WP_REST_Attachments_Controller is overridden in add_rest_api_support_for_post_type function in class-rest-api-enabler.php:
$wp_post_types[ $post_type_slug ]->show_in_rest = $option['show_in_rest'];
$wp_post_types[ $post_type_slug ]->rest_base = $option['rest_base'];
$wp_post_types[ $post_type_slug ]->rest_controller_class = 'WP_REST_Posts_Controller';
This can be solved by removing the last line:
$wp_post_types[ $post_type_slug ]->rest_controller_class = 'WP_REST_Posts_Controller';
]]>
Just a heads up
In /rest-api-enabler/includes/class-rest-api-enabler.php
I had to change it from
$post_meta_checked = get_post_meta_checked();
to
$post_meta_checked = $this->get_post_meta_checked();
after that, it worked fine.
]]>