Changeset 42343 for trunk/src/wp-includes/functions.wp-scripts.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.wp-scripts.php
r38810 r42343 39 39 } 40 40 41 _doing_it_wrong( $function, sprintf( 42 /* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */ 43 __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 44 '<code>wp_enqueue_scripts</code>', 45 '<code>admin_enqueue_scripts</code>', 46 '<code>login_enqueue_scripts</code>' 47 ), '3.3.0' ); 41 _doing_it_wrong( 42 $function, sprintf( 43 /* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */ 44 __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 45 '<code>wp_enqueue_scripts</code>', 46 '<code>admin_enqueue_scripts</code>', 47 '<code>login_enqueue_scripts</code>' 48 ), '3.3.0' 49 ); 48 50 } 49 51 … … 109 111 110 112 if ( false !== stripos( $data, '</script>' ) ) { 111 _doing_it_wrong( __FUNCTION__, sprintf( 112 /* translators: 1: <script>, 2: wp_add_inline_script() */ 113 __( 'Do not pass %1$s tags to %2$s.' ), 114 '<code><script></code>', 115 '<code>wp_add_inline_script()</code>' 116 ), '4.5.0' ); 113 _doing_it_wrong( 114 __FUNCTION__, sprintf( 115 /* translators: 1: <script>, 2: wp_add_inline_script() */ 116 __( 'Do not pass %1$s tags to %2$s.' ), 117 '<code><script></code>', 118 '<code>wp_add_inline_script()</code>' 119 ), '4.5.0' 120 ); 117 121 $data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) ); 118 122 } … … 168 172 * } 169 173 * 170 *171 174 * @see WP_Dependencies::localize() 172 175 * @link https://core.trac.wordpress.org/ticket/11520 … … 217 220 ) { 218 221 $no = array( 219 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 220 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', 221 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', 222 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', 223 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', 224 'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone', 222 'jquery', 223 'jquery-core', 224 'jquery-migrate', 225 'jquery-ui-core', 226 'jquery-ui-accordion', 227 'jquery-ui-autocomplete', 228 'jquery-ui-button', 229 'jquery-ui-datepicker', 230 'jquery-ui-dialog', 231 'jquery-ui-draggable', 232 'jquery-ui-droppable', 233 'jquery-ui-menu', 234 'jquery-ui-mouse', 235 'jquery-ui-position', 236 'jquery-ui-progressbar', 237 'jquery-ui-resizable', 238 'jquery-ui-selectable', 239 'jquery-ui-slider', 240 'jquery-ui-sortable', 241 'jquery-ui-spinner', 242 'jquery-ui-tabs', 243 'jquery-ui-tooltip', 244 'jquery-ui-widget', 245 'underscore', 246 'backbone', 225 247 ); 226 248 … … 267 289 _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); 268 290 269 270 291 if ( $src || $in_footer ) { 271 292 $_handle = explode( '?', $handle ); … … 332 353 * @return bool True on success, false on failure. 333 354 */ 334 function wp_script_add_data( $handle, $key, $value ) {355 function wp_script_add_data( $handle, $key, $value ) { 335 356 return wp_scripts()->add_data( $handle, $key, $value ); 336 357 }
Note: See TracChangeset
for help on using the changeset viewer.