Closed metaline closed 2 years ago
I set this route:
$routes->addRoute(new QueryRoute( "/corsi/{slug:[a-z0-9\-]+}", function (array $matches) { return [ 'post_type' => 'product', 'name' => $matches['slug'], ]; } ));
But if I call get_post() inside template, I get false, instead of the WP_Post object.
get_post()
false
WP_Post
I believe the problem is due to WordPress 6.0
I set this route:
But if I call
get_post()
inside template, I getfalse
, instead of theWP_Post
object.I believe the problem is due to WordPress 6.0