Skip to content

Commit 681b3b6

Browse files
committed
Add bypass mechanism for doing it wrong
1 parent 56682c3 commit 681b3b6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/wp-includes/class-wp-dependencies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function add_data( $handle, $key, $value ) {
289289
if ( ! isset( $this->registered[ $handle ] ) ) {
290290
return false;
291291
}
292-
if ( 'conditional' === $key ) {
292+
if ( 'conditional' === $key && '_required-conditional-dependency_' !== $value ) {
293293
_deprecated_argument(
294294
'WP_Dependencies->add_data()',
295295
'6.9.0',

src/wp-includes/script-loader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ function wp_default_scripts( $scripts ) {
10541054

10551055
// Not used in core, obsolete. Registered for backward compatibility.
10561056
$scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2015-05-03' );
1057+
did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', '_required-conditional-dependency_' );
10571058

10581059
$scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.13.7', 1 );
10591060
$scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.6.0', 1 );

0 commit comments

Comments
 (0)