Skip to content

Commit

Permalink
Merge pull request #36 from metaline/issue-35
Browse files Browse the repository at this point in the history
Fixed get_post() call inside template (see #35)
  • Loading branch information
gmazzap authored Oct 5, 2022
2 parents dd6484c + fa398b5 commit bf8a53c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Cortex.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ public static function boot(RequestInterface $request = null)
$do = $instance->doBoot($wp, $do, $request);
unset($instance);

if ( ! $do ) {
$wp->query_posts();
}
if ( ! $do ) {
global $wp_version;

if ( $wp_version && version_compare( $wp_version, '6', '>=' ) ) {
$wp->query_posts();
$wp->register_globals();
}
}

return $do;
} catch (\Exception $e) {
Expand Down

0 comments on commit bf8a53c

Please sign in to comment.