Changeset 31223
- Timestamp:
- 01/17/2015 01:36:55 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-scripts.php
r31189 r31223 96 96 $this->in_footer = array_diff( $this->in_footer, (array) $handle ); 97 97 98 if ( null === $this->registered[$handle]->ver ) 98 $obj = $this->registered[$handle]; 99 100 if ( null === $obj->ver ) { 99 101 $ver = ''; 100 else 101 $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; 102 } else { 103 $ver = $obj->ver ? $obj->ver : $this->default_version; 104 } 102 105 103 106 if ( isset($this->args[$handle]) ) 104 107 $ver = $ver ? $ver . '&' . $this->args[$handle] : $this->args[$handle]; 105 108 106 $src = $this->registered[$handle]->src; 109 $src = $obj->src; 110 $cond_before = $cond_after = ''; 111 $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; 112 113 if ( $conditional ) { 114 $cond_before = "<!--[if {$conditional}]>\n"; 115 $cond_after = "<![endif]-->\n"; 116 } 107 117 108 118 if ( $this->do_concat ) { … … 116 126 */ 117 127 $srce = apply_filters( 'script_loader_src', $src, $handle ); 118 if ( $this->in_default_dir( $srce)) {128 if ( $this->in_default_dir( ) { 119 129 $this->print_code .= $this->print_extra_script( $handle, false ); 120 130 $this->concat .= "$handle,"; … … 127 137 } 128 138 139 140 141 142 143 144 129 145 $this->print_extra_script( $handle ); 130 if ( !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) { 146 147 if ( $has_conditional_data ) { 148 echo $cond_after; 149 } 150 151 if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { 131 152 $src = $this->base_url . $src; 132 153 } 133 154 134 if ( ! empty($ver) )135 $src = add_query_arg( 'ver', $ver, $src);155 if ( !) ) 156 $src = add_query_arg(); 136 157 137 158 /** This filter is documented in wp-includes/class.wp-scripts.php */ … … 141 162 return true; 142 163 143 $tag = " <script type='text/javascript' src='$src'></script>\n";164 $tag = ""; 144 165 145 166 /** -
trunk/src/wp-includes/functions.wp-scripts.php
r31202 r31223 272 272 return (bool) wp_scripts()->query( $handle, $list ); 273 273 } 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 -
trunk/tests/phpunit/tests/dependencies/scripts.php
r30517 r31223 85 85 $wp_scripts->base_url = $base_url_backup; 86 86 } 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 87 122 }
Note: See TracChangeset
for help on using the changeset viewer.