[theme-reviewers] Double enqueuing script, style & google fonts

mudthemes support contact at mudthemes.com
Tue May 13 12:55:46 UTC 2014


Well thanks for replying but my question is a bit different from the 
answer. Here it goes:

# Scenario 1:

Suppose Theme ABC enqueues a script which is a publicly available 
Javascript library (suppose 'tabulous.js'). The handle theme uses to 
enqueue the script is 'theme_slug_tabulous' and not 'tabulous'.

In this case if another plugin also enqueues 'tabulous.js' then the 
theme will output two different tabulous.js files.

Question: In case of a publicly available library, shouldn't the theme 
must use 'tabulous' instead of prefixing the theme slug.


# Scenario 2:

Another Theme XYZ enqueues a custom made javascript code with handle 
such as 'responsive' (without the theme-slug prefix).

Question: In this case, should not the theme prefix the handle?


# Scenario 3:

Different themes use different handles to enqueue Google fonts such as 
'Google-font-x'. Now this could create trouble when the same fonts are 
also enqueues via a plugin.

Question: Is there any way to define a specific handle for a specific 
Google font and reduce the issue of duplicacy.


Any suggestions, Thanks in Advance.






On 2014-05-13 07:27, Emil Uzelac wrote:
> INCLUDING STYLESHEETS AND SCRIPTS # [2]
> 
> 	* Themes are REQUIRED to enqueue all stylesheets and scripts,
> using wp_enqueue_style() [3]/wp_enqueue_script() [4], and hooked into
> an appropriate hook via callback function, rather than hard-coding
> stylesheet/script links or tags in the template.
> 
>  	* Themes are REQUIRED to use the Theme-specific hook for
> admin-enqueued scripts/stylesheets, e.g.
> admin_print_scripts-appearance_page_$menu_slug
>  	* Themes are RECOMMENDED to hook stylesheet and script enqueue
> callbacks into `wp_enqueue_scripts`
> 	* Themes may OPTIONALLY link the default stylesheet (style.css)
> directly in the document head, or via wp_enqueue_style(). Whichever
> method is used, the default stylesheet must be referenced
> via get_stylesheet_uri() [5]
> 
> 	* Themes are REQUIRED to use core-bundled scripts, if using such
> scripts
> 
> On Tue, May 13, 2014 at 2:58 AM, mudthemes support
> <contact at mudthemes.com> wrote:
> 
>> A question regarding enqueuing script, style & Google fonts. When
>> enqueuing them in a theme, the handle prefix should be what?
>> 
>> 1. JS Scripts and CSS files
>> i) For publicly available libraries?
>> ii) For custom created codes?
>> 
>> 2. Google Fonts
>> 1) When enqueued using <link> tag.
>> 
>> Any suggestions, please?
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers [1]
> 
> 
> 
> Links:
> ------
> [1] http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> [2]
> http://make.wordpress.org/docs/theme-developer-handbook/releasing-your-theme/theme-review-guidelines/#including-stylesheets-and-scripts
> [3]
> http://make.wordpress.org/docs/theme-developer-handbook/releasing-your-theme/theme-review-guidelines/Function_Reference/wp_enqueue_style
> [4]
> http://make.wordpress.org/docs/theme-developer-handbook/releasing-your-theme/theme-review-guidelines/Function_Reference/wp_enqueue_script
> [5]
> http://make.wordpress.org/docs/theme-developer-handbook/releasing-your-theme/theme-review-guidelines/Function_Reference/get_stylesheet_uri
> 
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers


More information about the theme-reviewers mailing list