• Resolved James

    (@jmdesignsolutions)


    Hi,

    I have another question concerning this plugin, I have some custom fields in a page template that I’d like to wrap in the plugin’s short code however I can’t seem to get them working. Is this possible with this plugin?

    Thanks,

    James

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter James

    (@jmdesignsolutions)

    Just to follow this up, the issue I’m having is that I have a page template with content not in the default WordPress body that I’d like to protect but I can’t seem to get it working using the short codes as the content is using an ACF repeater field which is in PHP.

    Plugin Author Daniel Iser

    (@danieliser)

    @jmdesignsolutions – Wrap all your ACF code for output buffering then use do_shortcode and a concatenated string with the ob output.

    ob_start();
    
    // do acf rendering here
    
    $content = ob_get_clean();
    echo do_shortcode('[content_control]' . $content . '[/content_control]');

    Hope that helps.

    Thread Starter James

    (@jmdesignsolutions)

    Hi,

    Thanks for the help, I’ve added your code in my page template file placing my ACF code where your comment is but nothing has changed, the content still shows?

    Is there anything else I need to add?

    Thanks,

    James

    Thread Starter James

    (@jmdesignsolutions)

    Ignore this, all sorted now.

    Thanks for your help!

    James

    Plugin Author Daniel Iser

    (@danieliser)

    @jmdesignsolutions – Awesome, yea this solution is solid ;). We use it regularly when capturing content is required.

    Btw, If you have a moment, I would very much appreciate if you could quickly rate the plugin, just to help us spread the word.

    Thread Starter James

    (@jmdesignsolutions)

    No problem, done ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Protect ACF Fields WIthin Shortcode’ is closed to new replies.