[theme-reviewers] Deregistering mediaelement style / script

Otto otto at ottodestruct.com
Thu Apr 10 21:13:34 UTC 2014


On Thu, Apr 10, 2014 at 2:59 PM, Afzaal <wordpress at thinkupthemes.com> wrote:

> Thanks Emil & Chip,
>
> So I just want to confirm incase I come across a similar issue in future.
> Is there ever a suitable reason to deregister a core style / script?
>
> I'm guessing the answer is no.
>
>
Actually, yes, there are a few reasons to do this, but as always, it
depends on the specific circumstances. It is not the recommended approach,
because of future incompatibility if the core code changes (which it likely
will in this area).

For this particular case, it is probably not necessary to unregister the
whole stylesheet just to apply a minor fix to it. CSS can be overridden
with more specific selectors. If this is such a minor fix as described in
that thread, then the fix can simply be added to his own theme's CSS files
with a more specific selector, and without replacing the existing
stylesheet. If he has questions on how to do this, tell him to email me the
specific details and I'll happily explain the right way.

There are specific cases where I've unregistered core scripts to replace
them with modified ones, but only when there is literally no other way, and
only in plugins, not in themes.

-Otto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140410/1cd74de2/attachment.html>


More information about the theme-reviewers mailing list