Skip to content

Commit

Permalink
Add workaround for doingitwrong warning (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv authored Mar 30, 2024
1 parent 344efe6 commit 27eef9f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions version-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@
require_once __DIR__ . '/src/Styles.php';
require_once __DIR__ . '/src/Scripts.php';

/**
* Set placeholder WP_Query before initializing Styles and Scripts to avoid
* _doing_it_wrong warning triggered since WP 5.8.
* @see https://core.trac.wordpress.org/ticket/53848
*/
$GLOBALS['wp_query'] = new \WP_Query();

$GLOBALS['wp_styles'] = new Styles();
$GLOBALS['wp_scripts'] = new Scripts();

unset($GLOBALS['wp_query']);

0 comments on commit 27eef9f

Please sign in to comment.