Essentially I am just looking for the standard way of adding ACF to a plugin
Sorry the code should have been
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;
}
function sh_setup_acf()
{
// 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' );
}
add_action( 'plugins_loaded', 'sh_setup_acf');