Skip to content

Commit

Permalink
Update PolyfillsTest::get_inline_script()
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Jul 6, 2023
1 parent 8f61904 commit 14e58fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/php/src/Admin/PolyfillsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ public function test_registration() {
*/
public static function get_inline_script( $handle, $position = 'after', $display = false ) {
if ( method_exists( wp_scripts(), 'get_inline_script_tag' ) ) {
return wp_scripts()->get_inline_script_tag( $handle, $position );
$script = wp_scripts()->get_inline_script_tag( $handle, $position );

if ( ! $script ) {
return false;
}

return $script;
} else {
return wp_scripts()->print_inline_script( $handle, $position, $display );
}
Expand Down

0 comments on commit 14e58fb

Please sign in to comment.