fake page doesn’t work with WP 6.1

[ad_1]

Thread Starter
hupe13

(@hupe13)

Solved with

function detect_fake_shortlink($return, $id, $context, $allow_slugs) {
	$url = isset($_SERVER["SCRIPT_URL"]) ? $_SERVER['SCRIPT_URL'] : "";
	if (strpos($url, "/fakeslug/") !== false ) {
		return true;
	}
	return $return;
}
// add the filter
add_filter( "pre_get_shortlink", "detect_fake_shortlink", 10, 4 );

But now and even before is still the error:
PHP Warning: Attempt to read property "post_parent" on null in /wp-includes/post-template.php on line 724

Thread Starter
hupe13

(@hupe13)

Set

		$wp_query->is_page             = false;
		$wp_query->is_singular         = false;

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer