• bernaertsmusic

    (@bernaertsmusic)


    hello,

    One of our plugins in not working correctly when the Font Awesome plugin is active, this is the answer we got:
    “This happens because their javascript files are being loaded on the entire admin side, which is interfering with ours and won’t allow our plugin to work properly.
    In this case, you will need to be in touch with them and ask them for a code to avoid this from happening.

    It should be easy, they simply need to avoid their files from loading on our pages, and that way the problem would be solved.”

Viewing 1 replies (of 1 total)
  • Plugin Author mlwilkerson

    (@mlwilkerson)

    Hi @bernaertsmusic.

    It’s by design that Font Awesome is loaded on the entire admin side, so that Font Awesome icons are usable everywhere. There is currently no way to block the loading of Font Awesome by this plugin on specific admin pages. This is something that has been discussed (here, and here), but has not been implemented.

    There are a couple of possible workarounds you could try, though.

    If you’re using Font Awesome with SVG/JS technology, you could try switching to using Webfont/CSS instead.

    The concern has been described as “their javascript files are being loaded on the entire admin side.” That is not specific enough to know which JavaScript files are resulting in conflict. But my hunch is that conflict most likely occurs when using Font Awesome with SVG/JS technology. (Is that your situation?) If so, then switching to Webfont/CSS technology (such as by changing the Technology setting in a Font Awesome Kit) could resolve this conflict.

    One caveat: If you’re using a Webfont/CSS Kit, then there is a Kit loader script, which is JavaScript that loads the appropriate webfont and CSS assets from the kits CDN. It seems unlikely that this kit loader script is what causes the problem, but again, without more specific information, I can only make an educated guess.

    If that kit loader script, loading Webfont/CSS results in a problem, then you could try loading purely Webfont/CSS using Font Awesome Free Webfont/CSS from the legacy CDN instead of a kit. (This option is not available for Font Awesome 6 Pro. You have to use a Kit to load Font Awesome 6 Pro with this plugin).

    If none of that works, then you may a deeper workaround, such doing a manual installation instead of using this plugin. One approach to doing that is documented here on the Font Awesome web site. In the code sample on that page, there’s a statement like this:

    foreach ( [ 'wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ] as $action ) {

    You could remove the ‘admin_enqueue_scripts’ item (as well as ‘login_enqueue_scripts’) if you wanted Font Awesome to load only on front end pages. So line of code would then look like this instead:

    foreach ( [ 'wp_enqueue_scripts' ] as $action ) {

Viewing 1 replies (of 1 total)
  • The topic ‘Font Awesome javascript files’ is closed to new replies.