imath / wp-statuses

WordPress plugin to ease Custom Post Statuses integration
GNU General Public License v2.0
161 stars 27 forks source link

PHP Error: `Trying to get property 'post_type' of non-object in /wp-statuses/inc/core/custom.php on line 50` #73

Closed bonny closed 1 year ago

bonny commented 1 year ago

Getting this error:

Trying to get property 'post_type' of non-object in /wp-statuses/inc/core/custom.php on line 50

It's this line:

if ( 'page' !== $post->post_type ) {

I think this is because of some other plugin calling apply_filters("the_content") when there is not global post. So not sure if this should be considered a bug of wp-statuses, but if a check for a post could be added that would be useful because you never know what other plugins do.. 🤷

Using Version: 2.1.5 of the plugin. PHP: 7.4 WP: 6.1.1