Problem when displaying a Not Found (404) page

[ad_1]

I had the plugin activated, but was not particularly using it. I was testing my own plugin to deliberately disallow access and get a page not found error.

The issue is within your routine edac_enqueue_scripts in includes/enqueue_scripts.php

If the global $post is null, then it sets $post_id to null.

Then it calls current_user_can( 'edit_post', $post_id )

When outputting the expected 404 page, I get this debug message:

Notice: Function map_meta_cap was called incorrectly. When checking for the edit_post capability, you must always check it against a specific post. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.) in /usr/share/wordpress/wp-includes/functions.php on line 5905

Deactivating your plugin made the message disappear.

Hope this is of use,

Neil James

 

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