Category : wordpress-rest-api

I’m wondering how I can get the Post Object data from a custom field with WordPress Rest API. Here’s my JS: import axios from ‘axios’ const getEvents = () => { return axios .get(‘https://127.0.0.1/wp-json/wp/v2/events’) .then(res => { console.log(res) return res }) .catch(err => { console.error(err) }) .then({}) } getEvents() It returns the object, but the ..

Read more

Rookie question for the Stack community. I have several forms on my WordPress website and they are connected with Google Leads. About a week ago, my Google Leads conversions dropped by about half. So I loaded the page in Google Chrome’s Dev Console and all of a sudden I am getting this Caldera Forms error: ..

Read more

Getting the following 500 code response when making my API call: PUT https://my-site.com/wp/wp-json/contact/v1/send 500 In functions.php my WP custom route is defined thus: function sendContactMail(WP_REST_Request $request) { } add_action(‘rest_api_init’, function () { register_rest_route( ‘contact/v1’, ‘send’, array( ‘methods’ => ‘PUT’, ‘callback’ => ‘sendContactMail’ )); }); Here’s how I’m making my API call: formData.append(‘contact_name’, this.contactName) formData.append(‘contact_email’, this.contactEmail) ..

Read more