Support

Account

Home Forums ACF PRO Tiny MCE / ACF Pro Bug

Solved

Tiny MCE / ACF Pro Bug

  • I believe I have found a bug in ACF5.

    When running ACF Pro inside your theme rather than as a plugin, the Tiny MCE script doesn’t seem to abide by any path filtering when it is included in the page. For example, if I set this in functions.php:

    add_filter('acf/settings/dir', function( $dir ) {
        return '/wp-content/themes/ThemeName/advanced-custom-fields/';
    });

    and then try to load a WYSIWYG field through ACF on a WP admin page it 404s looking for plugin.min.js

    I believe this only happens when WP is installed in a subdirectory. On post.php WordPress is looking for this file http://example.com/wp-content/themes/ThemeName/advanced-custom-fields/inc/tinymce/plugins/code/plugin.min.js when it should be looking for http://example.com/SUBDIR/wp-content/themes/goldenrule/advanced-custom-fields/inc/tinymce/plugins/code/plugin.min.js which is obviously causing major issues. Any help in getting this resolved or getting around it would be much appreciated.

  • Hi @bradwiatr

    Your ‘dir’ url will need to include the sub directory. You can also make use of the site_url function like so:

    return site_url('wp-content/themes/ThemeName/advanced-custom-fields');

    Hope that helps

    Thanks
    E

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

You must be logged in to reply to this topic.