Support » Plugin: Local Open Sans » Plugin doesn't work when viewing the public site with the admin bar

  • Plugin Author bluedauber

    (@bluedauber)


    Thanks for making this–I think the WordPress interface shouldn’t make remote calls by default, and this plugin almost fixes the dependency on Google Fonts.

    The plugin works great in the admin interface, but it doesn’t work for the admin bar that displays at the top of the page when you’re logged in and viewing the site.

    To fix it, I added the following hooks to my local copy:
    add_action( 'wp_enqueue_scripts', array( $this, 'replace_open_sans' ) );
    add_action( 'login_enqueue_scripts', array( $this, 'replace_open_sans' ) );

    It would be great if you could update the plugin with this fix!

    https://wordpress.org/plugins/local-open-sans/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ThemeBoy

    (@themeboy)

    @bluedauber Awesome, thanks for fixing that! I’ve added you as a committer to this plugin so you can add your hooks 🙂

    Plugin Author bluedauber

    (@bluedauber)

    @themeboy Thanks! After testing the login screen with my previous changes, I found the plugin still wasn’t working. It looks like login_enqueue_scripts doesn’t run early enough to deregister open-sans.

    I’ve found that running replace_open_sans at wp_loaded works better, as it runs a little earlier and works on site, admin, and login pages. The upgrade and install pages still call the remote font, but I don’t think plugins can change that.

    I’ve submitted my change for inclusion!

    Plugin Author ThemeBoy

    (@themeboy)

    Thanks @bluedauber, I’ve merged your changes and added you as a contributor to the plugin 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin doesn't work when viewing the public site with the admin bar’ is closed to new replies.