How to add an ACF field to a WP post

Hi there

I would like to add a custom ACF field to a post. But since there is not a third hierarchy where do I define the variables name?


This topic might help you The MAKE Wordpress plugins doesn't import custom fields - #2 by samliew

3 Likes

As usual. Everything looks correct to me, but there must be something not working. I tried to change a specific audio.

Please provide any error messages when there are errors.

2 Likes

You don’t need the the full URL for the URL line. It is relative to the …/v2 part so you can just enter

/audio/6719

in the URL part and the rest is taken care of for you by the Make an API Call module.

3 Likes

HI!

I got one step closer: no more error message, but the acf parameter hasn’t been updated.

bumpedibump… bump… bump…

Is this such an impossible task?

What might be wrong? I can’t see any problems with the syntax.

I noticed that the durata key has a value of 08:03 - is this a string? If so it should be within double " and in the post it appears it is not in double quotes.

Also I wonder if you need to include the id as part of the body? Without the API docs it is hard to tell – can you reply with the API docs for the /audio/ POST WordPress API call?

3 Likes

I found the error
I took the json from another thread, but there was an error. The comma after the parenthesis!

1 Like

Continuing the discussion from The MAKE Wordpress plugins doesn't import custom fields:

I don’t believe you need the trailing comma (,) near the end of the collection in the JSON above.

Here’s the correct one…

{
    "acf": {
        "field_slug": "value",
        "field_slug2": "value",
        "field_slug3": "value"
    }
}
2 Likes

I’m SURE I don’t need it… Because it didn’t work with the comma… :smiley:

3 Likes