Coder Social home page Coder Social logo

Comments (6)

justinkruit avatar justinkruit commented on June 16, 2024 1

That's more work than a // on the enqueue or a add_filter('who_says_you_cant_code_onmobile', '__retrun_false');. The idea here is to make it as easy as possible to opt out of FA.

Function "__retrun_false" not found. Maybe develop on pc? 😜

Currently looking into this, with the idea to add more filters in general.

from bootscore.

crftwrk avatar crftwrk commented on June 16, 2024

If you have an idea, please create a PR. But @justinkruit is FA pro user as well, maybe he has an idea or can quickly explain how he solves that.

from bootscore.

justinkruit avatar justinkruit commented on June 16, 2024

I see the mentioned using priorities etc. Have you tried making a new function in your child theme, dequeue fontawesome in there, and then register that function as a hook with a later priority? That should solve this issue. (Can't write an example at the moment, as I'm on my phone haha)

from bootscore.

androidacy-user avatar androidacy-user commented on June 16, 2024

I see the mentioned using priorities etc. Have you tried making a new function in your child theme, dequeue fontawesome in there, and then register that function as a hook with a later priority? That should solve this issue. (Can't write an example at the moment, as I'm on my phone haha)

That's more work than a // on the enqueue or a add_filter('who_says_you_cant_code_onmobile', '__retrun_false');. The idea here is to make it as easy as possible to opt out of FA.

from bootscore.

androidacy-user avatar androidacy-user commented on June 16, 2024

That's more work than a // on the enqueue or a add_filter('who_says_you_cant_code_onmobile', '__retrun_false');. The idea here is to make it as easy as possible to opt out of FA.

Function "__retrun_false" not found. Maybe develop on pc? 😜

Currently looking into this, with the idea to add more filters in general.

That's probably exactly why I misspelled that lolol. Used to autocorrect from mobile.

from bootscore.

smileBeda avatar smileBeda commented on June 16, 2024

So, if I am not totally obtuse, you can and should do this:

  1. In the child theme do the usual parent and child themes styles enqueue stuff. So generally that means add_action( 'wp_enqueue_scripts', 'bootscore_child_enqueue_styles' ); and in the CB, you just use the default parent enqueue and child enqueue
  2. Then, in the child theme, in a separate callback you do add_action( 'wp_enqueue_scripts', 'go_away', 11 ); where the CB does:
function go_away(){
	wp_dequeue_style( 'fontawesome' );
}

This should work. The reason you need priority 11 is that the parent theme uses default 10, and if you load this dequeue on the same priority it wont work. You could of course also go max and use PHP_INT_MAX - 2 just to leave some space for someone to re-enqueue it after (you never know)

I suggest to also do remove_filter('style_loader_tag', 'bootscore_fa_preload'); so you do not get any overhead (even if the fa styles are gone, this fn still runs unless you remove it)

This should do the trick.

from bootscore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.