Deregistering WordPress stylesheets is one of those things that we don’t always have to consider.
If you’re starting a project from scratch, then it’s usually safe to say that you’re starting a project at ground zero and have control over most of the assets that are to be enqueued in the project.
On the other hand, if you’re coming into a project at a later date or you’re working on a plugin that has to work in conjunction with another plugin that might use a shared stylesheet then you may need to deregister an existing asset to make sure everything works well together.
Deregistering WordPress Stylesheets (in 60 Seconds)
How do we do that, though?
That is, let’s say that we have a project that’s using a specific set of styles – perhaps a certain set of styles for specific functionality – and the plugin we’re working on needs to use an updated stylesheet (because the previous plugin hasn’t been updated).
In a short video for Envato, I tackle precisely this problem.
From the post:
There are times in which we inherit a WordPress project that’s already been in use for some time. This means that we’re likely dealing with some form of legacy code, be it at the theme level or the plugin level.
The article on deregistering WordPress stylesheets can be found here along with a list of other resources that are helpful if this is something that’s new to you.
Done in 60 Seconds?
The “In 60 Second” series is something new and worth checking out, especially if you’re an intermediate developer. Beginners may gain something from these videos, too but I think that some of the background information (or the links shared in the resources) may be necessary reading.
Anyway, this isn’t the first video that I’ve shared like this and it’s not going to be the last.
Deregistering WordPress Stylesheets was written by Tom. For more information about WordPress, development, and resources then visit Tom McFarlin’s blog.
Read more here:: Deregistering WordPress Stylesheets