Support

Account

Home Forums ACF PRO ACF 5 PRO Wonky Admin Styles

Solved

ACF 5 PRO Wonky Admin Styles

  • I just updated ACF to ACF 5 Pro as I use the gallery and repeater add ons for my custom post type on this client site. Almost everything is working, but in the category admin screens, the styles aren’t loading. This is happening for post type categories, custom post type categories, tags, etc. All other admin pages seem fine. I also notice that on some of my admin pages, the js is not working as I cannot pull the screen options tag down. Beyond this, everything seems to be working well. As soon as I deactivate ACF 5 PRO, everything works as expected. Anyone else experiencing/reported these issues?

  • BTW, everything works fine w/ ACF 4.3.8 w/ the Repeater and Gallery Add Ons installed. I have reverted back to these versions for the time being until the issue can be corrected and I have gone ahead and submitted a support ticket.

  • Paths on my live server are incorrect as well with ACF5 Pro included in theme. Console returns 404 errors for various admin-side js and css. This is the path being called:

    http://site.com/wp-content/plugins/home/user/public_html/wp-content/themes/dev/advanced-custom-fields-pro/inc/datepicker/jquery-ui-1.10.4.custom.min.css?ver=5.0.0

  • So playing around with ‘advanced-custom-fields-pro/acf.php’ I noticed dir is plugin_dir_url which makes ‘wp-content/plugins/’

    Looking in ACF4 ‘advanced-custom-fields-pro/acf.php’ I see the function helpers_get_dir( $file ) which locates the proper directory and fixes win issues.

    Adding function helpers_get_dir() to ‘advanced-custom-fields-pro/acf.php’ and replacing:

    ‘dir’ => plugin_dir_url( __FILE__ ),
    with
    ‘dir’ => helpers_get_dir(__FILE__ ),

    Appears to fix the situation.

    Obviously, this isn’t a proper fix. Just a direction to the issue.

    -WilliamH

  • @ WilliamH right on, this seems to be what was reference in this thread. Waiting to see if this helper function makes its way back into this version.

  • Hi guys.

    I have removed the auto url / path finder function due to issues on specific server setups and opted for the default wp_plugin function.

    You can hook in and customize the url / path like so:

    
    add_filter('acf/settings/dir', function( $dir ){
    
        return 'custom/dir/to/acf/folder';
    
    });
    
    add_filter('acf/settings/path', function( $path ){
    
        return 'custom/path/to/acf/folder';
    
    });
    
    

    You can also filter the show_admin setting and return false to hide all ACF admin stuff

  • It works like a charm! Thank you Elliot.

  • So, where do I need to add the indicated filters in order to get the plugin to work? In which file? In one of the plugin’s files? Or, do I put this in one of my child theme’s files?

  • Thanks Elliot. To help clarify, I’ve added this to functions.php to allow for various environments, then included the plugin/options as described in the docs.

    add_filter('acf/settings/dir', function( $dir ){
      return get_template_directory_uri() . '/advanced-custom-fields-pro/';
    });
    
    add_filter('acf/settings/path', function( $path ){
      return get_theme_root() . '/' . get_template() . '/advanced-custom-fields-pro/';
    });
    
    add_filter('acf/settings/show_admin', function( $path ){
      return true; // Set false to hide UI in admin
    });
Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘ACF 5 PRO Wonky Admin Styles’ is closed to new replies.