Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Thematic doesn't use wp_enqueue for head scripts. Why? « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Thematic doesn't use wp_enqueue for head scripts. Why?

(5 posts)
  • Started 4 years ago by pixelfresh
  • Latest reply from pixelfresh
  • This topic is not resolved

Tags:

  1. pixelfresh
    Member

    Perhaps I'm missing something, but shouldn't thematic use the WordPress function wp_enqueue for it's javascripts in the head by default? Currently, it uses the a hacked together function shown below (located in header-extensions.php). Using wp_register and wp_enqueue is standard, would be better for caches due to versioning, and would make getting rid of scripts a lot easier (through deregister), no?

    // Load scripts for the jquery Superfish plugin http://users.tpg.com.au/j_birch/plugins/superfish/#examples
    if (function_exists('childtheme_override_head_scripts'))  {
        function thematic_head_scripts() {
        	childtheme_override_head_scripts();
        }
    } else {
        function thematic_head_scripts() {
    	    $scriptdir_start = "\t";
    	    $scriptdir_start .= '<script type="text/javascript" src="';
    	    $scriptdir_start .= get_bloginfo('template_directory');
    	    $scriptdir_start .= '/library/scripts/';
    
    	    $scriptdir_end = '"></script>';
    
    	    $scripts = "\n";
    	    $scripts .= $scriptdir_start . 'hoverIntent.js' . $scriptdir_end . "\n";
    	    $scripts .= $scriptdir_start . 'superfish.js' . $scriptdir_end . "\n";
    	    $scripts .= $scriptdir_start . 'supersubs.js' . $scriptdir_end . "\n";
    	    $dropdown_options = $scriptdir_start . 'thematic-dropdowns.js' . $scriptdir_end . "\n";
    
    	    $scripts = $scripts . apply_filters('thematic_dropdown_options', $dropdown_options);
    
    	    	$scripts .= "\n";
    	    	$scripts .= "\t";
    	    	$scripts .= '<script type="text/javascript">' . "\n";
    	    	$scripts .= "\t\t" . '/*<![CDATA[*/' . "\n";
    	    	$scripts .= "\t\t" . 'jQuery.noConflict();' . "\n";
    	    	$scripts .= "\t\t" . '/*]]>*/' . "\n";
    	    	$scripts .= "\t";
    	    	$scripts .= '</script>' . "\n";
    
    	    // Print filtered scripts
    	    print apply_filters('thematic_head_scripts', $scripts);
    	}
    
    	if (apply_filters('thematic_use_superfish', TRUE)) {
    		add_action('wp_head','thematic_head_scripts');
    	}
    }
    Posted 4 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    helgatheviking

    Moderator

    i've been wondering that for a while too. if i need them i usually filter away thematic's version, package them all together as 1 script, and then enqueue that.

    Posted 4 years ago #
  3. pixelfresh
    Member

    Right, I'll probably hook in and do the same, but seems strange that this is necessary. Should be enqueue'ing from the start.

    Posted 4 years ago #

  4. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Chris

    Moderator

    Next version will use enqueue for scripts and CSS.

    Chris

    Posted 4 years ago #
  5. pixelfresh
    Member

    Great to hear, thanks for all your work on this Chris.

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183