Support

Account

Home Forums ACF PRO Import/Export page empty

Solved

Import/Export page empty

  • I recently upgraded to ACF Pro, and for some reason my Import/Export page and the Updates page are both empty in the admin panel. I’m not seeing anything in the error logs, any idea what could be causing this?

    Note: I have ACF included in my theme rather than installed as a plugin

  • Setting this value:

    add_filter('acf/settings/path', function( $path ){
        return '/full/server/parth/wp-content/themes/themename/advanced-custom-fields/';
    });

    fixed this issue. Is there a way to set this relative to the WP install location rather than a full path? The path will obviously change when I hand my theme off to clients who then use it on their own server.

  • Hi @bradwiatr

    WP contains some handy functions to retrieve urls / paths to the WP installation. Something like this should work a treat:

    
    include_once( get_template_directory() . '/lib/acf/acf.php' );
    add_filter('acf/settings/dir', function( $dir ){
        return get_template_directory_uri() . '/lib/acf/';
    });
    add_filter('acf/settings/path', function( $path ){
        return get_template_directory() . '/lib/acf/';
    });
    
  • As in current example get_template_directory_uri() is used:

    Note that get_template_directory_uri() / get_template_directory() returns the path to the parent theme if a child theme is used.

    Better use get_stylesheet_directory_uri() / get_stylesheet_directory() to always get the currently used theme.

  • Hi @thomask

    Nice one! I’ll update the docs

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.