yoast-acf-analysis icon indicating copy to clipboard operation
yoast-acf-analysis copied to clipboard

ACF Shortcode won't work

Open koditips opened this issue 8 years ago • 5 comments

Hello,

In my posts I use the ACF shortcode for text fields [acf field="text"] but the addon doesn't seem to recognize those and my Yoast does not recognize ACF.

Is the ACF shortcode supported by this plugin or what is the better way I should use ACF in my new posts?

Thanks,

koditips avatar Apr 27 '17 12:04 koditips

This is currently not possible and will also not be included in the upcoming release. I'm keeping it as an enhancement idea here anyway.

But this won't be easy so don't hold your breath for it, sorry.

kraftner avatar Aug 10 '17 17:08 kraftner

This is a tricky one.

The shortcode allows the retrieval of fields from some other post. To support that we'd need to create some API or maybe use the REST API to get that data from the server while editing another post.

When only using data from the same post we might be able to do this as we have already scraped all fields anyway. The fact that the docs state

Limitations

  • Only works for simple text based values

might save us here. But we'd need to have a closer look at ACF to see how this is handled there to see if we can replicate the behaviour with reasonable effort.

kraftner avatar Oct 18 '17 08:10 kraftner

Possibly relevant: https://github.com/Yoast/wordpress-seo/issues/4133#event-906393703

kraftner avatar Nov 03 '17 14:11 kraftner

Please inform customer #1008005 when this conversation is closed.

suascat avatar Apr 27 '23 07:04 suascat

Currently, the shortcodes are detected when using the Yoast-ACF glue plugin. But the text field is wrapped in a paragraph tag which causes the content before/after to be treated separate from the ACF content which may cause unexpected feedback (the colored bullets). Removing the paragraph tags should help the text field shortcodes work in a more consistent behavior.

Example: I tested an ACF text field called city with a single word 'London'. 1112590_city_in_paragraph

amboutwe avatar Mar 20 '24 00:03 amboutwe