Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Call wp_enqueue_script from within an action.

As of WP 3.3 this is the preferred usage.

Thanks to Henry C. Gernhardt, III and Martin Lormes for reporting
this issue.
  • Loading branch information...
commit d56335491315e413e826459db0a77afd6648c507 1 parent faae642
@beastaugh authored
View
8 changelog.txt
@@ -1,5 +1,13 @@
# Changelog
+### Version 3.1.3
+
+#### Bug fixes
+
+ * `wp_enqueue_script` is now only called from within actions, as per a change
+ in WordPress 3.3.
+
+
### Version 3.1.2
#### Bug fixes
View
5 functions.php
@@ -174,10 +174,7 @@
add_action('admin_head', 'maybe_wipe_tarski_options');
} else {
// JavaScript
- wp_enqueue_script('tarski',
- tarski_asset_path('app/js/tarski.js'),
- array('jquery'), theme_version());
- wp_enqueue_script('comment-reply');
+ add_action('wp_enqueue_scripts', 'tarski_enqueue_scripts');
}
// Header
View
23 library/helpers/template_helper.php
@@ -157,6 +157,28 @@ function tarski_meta() {
}
/**
+ * Enqueue Tarski's own JavaScript and the comment reply script.
+ *
+ * @since 3.1.3
+ *
+ * @uses wp_enqueue_script
+ * @uses tarski_asset_path
+ * @uses theme_version
+ *
+ * @see tarski_meta
+ * @see tarski_stylesheets
+ *
+ * @return void
+ */
+function tarski_enqueue_scripts() {
+ wp_enqueue_script('tarski',
+ tarski_asset_path('app/js/tarski.js'),
+ array('jquery'), theme_version());
+
+ wp_enqueue_script('comment-reply');
+}
+
+/**
* Generate links to the various Tarski stylesheets.
*
* @since 2.7
@@ -167,7 +189,6 @@ function tarski_meta() {
* @uses _tarski_asset_output
*
* @see tarski_meta
- * @see tarski_javascript
*
* @return void
*
View
2  style.css
@@ -5,7 +5,7 @@ Description: An elegant, flexible theme developed by <a href="http://extralogica
Author: Benedict Eastaugh and Chris Sternal-Johnson
Author URI: http://tarskitheme.com/about/
Tags: white, two-columns, left-sidebar, right-sidebar, fixed-width, custom-colors, custom-header, custom-background, custom-menu, editor-style, theme-options, threaded-comments, sticky-post, microformats, rtl-language-support, translation-ready
-Version: 3.1.2
+Version: 3.1.3
License: GNU General Public License, v2
License URI: http://www.opensource.org/licenses/gpl-2.0.html
*/
View
2  style.dev.css
@@ -5,7 +5,7 @@ Description: An elegant, flexible theme developed by <a href="http://extralogica
Author: Benedict Eastaugh and Chris Sternal-Johnson
Author URI: http://tarskitheme.com/about/
Tags: white, two-columns, left-sidebar, right-sidebar, fixed-width, custom-colors, custom-header, custom-background, custom-menu, editor-style, theme-options, threaded-comments, sticky-post, microformats, rtl-language-support, translation-ready
-Version: 3.1.2
+Version: 3.1.3
License: GNU General Public License, v2
License URI: http://www.opensource.org/licenses/gpl-2.0.html
*/

0 comments on commit d563354

Please sign in to comment.
Something went wrong with that request. Please try again.