[wp-trac] [WordPress Trac] #24595: Twenty Thirteen: Load Genericons in a More Plugin-friendly Way
WordPress Trac
noreply at wordpress.org
Tue Jun 18 08:20:27 UTC 2013
#24595: Twenty Thirteen: Load Genericons in a More Plugin-friendly Way
------------------------------+-----------------------------
Reporter: celloexpressions | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Keywords:
------------------------------+-----------------------------
Genericons are a useful tool for plugins, but it is currently difficult to
use them in a plugin in an efficient way. It would be nice if Twenty
Thirteen loaded them in a way that would both play nicely with plugins
that want to use them and set a standard for how plugins should load them.
I came up with a couple of options:
- Package Genericons directly with WordPress, instead of bundled through
Twenty Thirteen, and register as a style in core
({{{wp_register_style()}}}), then {{{wp_enqueue_style('genericons')}}} in
both Twenty Thirteen and plugins. Plugins could also package Genericons if
targeting WordPress <3.6. The loaded stylesheet would just contain the
{{{@font-face}}} declaration. But having Genericons available directly in
core wouldn't be as appropriate as, for example, having Dashicons
available (for front-end use) would be.
- Move the {{{@font-face}}} declaration to its own file and load it with
{{{wp_register/enqueue_style()}}}. Plugins could check for Genericons with
{{{wp_style_is()}}} and load them if necessary, which would decrease the
potential to load from multiple places. This would establish a "correct"
method for loading Genericons in plugins and at least provide the tools to
avoid duplicate declarations, but could be messier to implement in
plugins.
Both methods have advantages and disadvantages, and there are probably
additional possibilities, but I think we should do something a bit more
standardized than the current setup (loading Genericons from the main
{{{style.css}}} file).
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24595>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list