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' );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.