Support

Account

Home Forums ACF PRO Use ACF in custom plugin without duplicating ACF install

Helping

Use ACF in custom plugin without duplicating ACF install

  • Is there a way to use ACF in a custom plugin, without duplicating ACF into my custom plugin? It’s already installed at the WordPress level and being used across the site for other things.

    Here is what I need to do:

    My custom plugin is all relating to a specific CPT, Services. On activation, the custom plugin creates a page template for the Services landing page, generates some Services taxonomies, and generates ACF fields only used on the Services landing page or Services single posts.

    I’d like to store all custom fields (JSON or PHP) associated with this CPT in the plugin. I need to do this in a way that it won’t interfere with creating new or editing existing fields (saved as PHP) used on the rest of the site.

    I’ve tried looking online but I can’t see if this is possible.

    Thank you!

  • The only way to do that is to inform people that the ACF plugin is required. There are things that you can add to your plugin that will automatically install other plugins if they are not installed so that they can be updated as other plugins.

    What you want to do for loading the custom fields can be done by adding an acf-json folder to your plugin, move the field groups for your plugin into this folder and then adding a load point https://www.advancedcustomfields.com/resources/local-json/

    You can hide your field groups so they cannot be syned by editing the json file and setting them to private

    
    
        "modified": 1503334184,
    		"private": true
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.