Home › Forums › Backend Issues (wp-admin) › How to run ACF plugin once mytheme already ACF pro plugin › Reply To: How to run ACF plugin once mytheme already ACF pro plugin
Solved by myself.
just find the correct directories and put on child.
/*ACF*/
// 1. customize ACF path
add_filter('acf/settings/path', 'my_acf_pro_settings_path');
function my_acf_pro_settings_path( $path ) {
$path = get_template_directory() . '/includes/acf-pro/';
return $path;
}
// 2. customize ACF dir
add_filter('acf/settings/dir', 'my_acf_pro_settings_dir');
function my_acf_pro_settings_dir( $dir ) {
$dir = get_template_directory_uri() . '/includes/acf-pro/';
return $dir;
}
// 3. Hide ACF field group menu item
if ( ! has_filter( 'acf/settings/show_admin' ) ) {
add_filter('acf/settings/show_admin', '__return_true');
}
// 4. Include ACF
include_once( get_template_directory() . '/includes/acf-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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.
— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.
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.