Support

Account

Home Forums ACF PRO Problem including ACF Pro in custom plugin Reply To: Problem including ACF Pro in custom plugin

  • Hi

    Ive succeeded to solve this issue at least in my end

    Heres the code:

    
    // 1. customize ACF path
    add_filter('acf/settings/path', 'my_acf_settings_path');
    
    function my_acf_settings_path( $path ) {
    
    // update path
    $path = dirname( __FILE__ ) .  '/libs/acf/';
    
    // return
    return $path;
    
    }
    
    // 2. customize ACF dir
    add_filter('acf/settings/dir', 'my_acf_settings_dir');
    
    function my_acf_settings_dir( $dir ) {
    
    // update path
    $dir = plugin_dir_url( __FILE__ ) . 'libs/acf/';
    
    // return
    return $dir;
    
    }
    
    // 3. Hide ACF field group menu item
    //add_filter('acf/settings/show_admin', '__return_false');
    
    // 4. Include ACF
    include_once( 'libs/acf/acf.php' );