Ticket #16024: conditional-comments-for-js.16024.diff
File conditional-comments-for-js.16024.diff, 1.2 KB (added by , 13 years ago) |
---|
-
wp-includes/class.wp-scripts.php
82 82 if ( !parent::do_item($handle) ) 83 83 return false; 84 84 85 $start_cond = $end_cond = ''; 86 85 87 if ( 0 === $group && $this->groups[$handle] > 0 ) { 86 88 $this->in_footer[] = $handle; 87 89 return false; … … 112 114 $this->ext_version .= "$handle$ver"; 113 115 } 114 116 } 117 118 if ( isset($this->registered[$handle]->extra['conditional']) && $this->registered[$handle]->extra['conditional'] ) { 119 $start_cond = "<!--[if {$this->registered[$handle]->extra['conditional']}]>\n"; 120 $end_cond = "<![endif]-->\n"; 121 } 115 122 116 123 $this->print_scripts_l10n( $handle ); 117 124 if ( !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) { … … 125 132 if ( $this->do_concat ) 126 133 $this->print_html .= "<script type='text/javascript' src='$src'></script>\n"; 127 134 else 128 echo " <script type='text/javascript' src='$src'></script>\n";135 echo "{$start_cond}<script type='text/javascript' src='$src'></script>\n{$end_cond}"; 129 136 130 137 return true; 131 138 }