Home Forums General Issues Bundling ACF in plugin Reply To: Bundling ACF in plugin

  • I don’t know that there is a standard way to set up acf in a plugin other than what is posted.

    But I would try adding the filters for the acf functions without them being in another filter first to see if that corrects the problem you’re seeing.

    function my_acf_settings_path( $path )
        // update path
        $path = plugin_dir_path() . 'myplugin/vendors/advanced-custom-fields-pro/';
        // return
        return $path;
    function my_acf_settings_dir( $dir )
        // update path
        $dir = plugin_dir_path() . 'myplugin/vendors/advanced-custom-fields-pro/';
        // return
        return $dir;
    	// Include ACF.
    	// 1. customize ACF path
    	add_filter('acf/settings/path', 'my_acf_settings_path');
    	// 2. customize ACF dir
    	add_filter('acf/settings/dir', 'my_acf_settings_dir');
    	// 3. Hide ACF field group menu item
    	add_filter('acf/settings/show_admin', '__return_true');
    	// 4. Include ACF
    	include_once( plugin_dir_path() . 'myplugin/vendors/advanced-custom-fields-pro/acf.php' );