Skip to content

Commit 14e4ff9

Browse files
Copilotsirreal
andcommitted
Remove redundant is_array check and improve test naming
Co-authored-by: sirreal <[email protected]>
1 parent 4e490ee commit 14e4ff9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ public function print_script_data() {
12801280
*/
12811281
$data = apply_filters( "script_data_{$handle}", array() );
12821282

1283-
if ( is_array( $data ) && ! empty( $data ) ) {
1283+
if ( ! empty( $data ) ) {
12841284
wp_print_inline_script_tag(
12851285
(string) wp_json_encode(
12861286
$data,

tests/phpunit/tests/dependencies/scripts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,11 +4124,11 @@ public function test_wp_scripts_doing_it_wrong_for_missing_dependencies() {
41244124
}
41254125

41264126
/**
4127-
* Tests that the script_data_{$handle} filter outputs JSON script tags.
4127+
* Tests that print_script_data outputs JSON script tags.
41284128
*
41294129
* @covers WP_Scripts::print_script_data
41304130
*/
4131-
public function test_script_data_filter_outputs_json_script_tag() {
4131+
public function test_print_script_data_outputs_json_script_tag() {
41324132
wp_enqueue_script( 'test-script', '/test.js', array(), null );
41334133

41344134
add_filter(

0 commit comments

Comments
 (0)