Support » Plugin: ACF to REST API » Cant get POST [Fields] to Work

  • Resolved bwdgroup


    I just can’t get to POST ACF fields but WP fields are fine.

    My HTML Front-End, my custom ACF field is called model as per the example I have added fields and put the field into bracket.

    <div class="admin-quick-add">
      <h3>Quick Add Post</h3>
      <input type="text" name="title" placeholder="Title">
      <input type="text" name="fields[model]" placeholder="Model">
      <textarea name="content" placeholder="Content"></textarea>
      <button id="quick-add-button">Create Vehicle</button>

    I have a Javascript file performing the JSON function this is the snippet to capture the form data.

    	var ourVehicleData = {
    				"title" : document.querySelector('.admin-quick-add [name="title"]').value,
    				"fields[model]" : document.querySelector('.admin-quick-add [name="fields[model]"]').value,
    				"content" : document.querySelector('.admin-quick-add [name="content"]').value,
    				"status" : "publish"
    			var createVehicle = new XMLHttpRequest();"POST", "");
    			createVehicle.setRequestHeader("X-WP-Nonce", auth_user.nonce);
    			createVehicle.setRequestHeader("Content-Type", "application/json", "charset=UTF-8");

    – I have request version 3 in the settings.
    – Both custom fields show in rest and can edit in rest.

    Any help on this would be much appreciated.


    • This topic was modified 1 year, 3 months ago by bwdgroup.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Please note that you have requested v3, but in your code"POST", "");
    you refer to v2.
    Hope it helps

    Thanks, The way point is now

    It will post the title and content but ignores the custom field.

    So frustrating.

    just noticed you cannot create new posts with ACF data but only edit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cant get POST [Fields] to Work’ is closed to new replies.