-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Describe the feature request
After ACF 6.3.4 they (WP Engine) added a "is_post_publicly_viewable" test in their logic. That test "fails" for popups, so the ACF shortcode won't run for popups by default now. When I added an ACF filter hook (see below) to ignore that check, my ACF shortcodes started working in popups.
/** Make the ACF fields available to non-public posts like popups. */
add_filter( 'acf/shortcode/prevent_access_to_fields_on_non_public_posts', '__return_false' );Use case
When someone wants to use the ACF shortcode to display an ACF value inside the popup content.
Test case
Make sure your ACF settings are correct. I have some notes in this gist https://gist.github.com/marklchaves/75780b2d7ba9c9508e6da586147a859f.
- Create a popup.
- Create an ACF in the popup and give it a text value. E.g., "Hello, World!"
- Add the ACF shortcode to the popup's content editor. E.g.,
[acf field="test" post_id="1"]. - Test the popup. The popup displays without the value of the shortcode.
- Add the filter from the description section above.
- Retest the popup. Now, the popup should display with the ACF value.
Example screenshots (if any)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels