Attempt to read property “post_type” on null

[ad_1]

hi after updates, and also PHP updates I get this error on the site:

Warning: Attempt to read property “post_type” on null in … wp-content/plugins/events-manager/classes/em-event-post.php on line 207

Lines 205-210 of events-manager/classes/em-event-post.php are as follows:

public static function the_category( $thelist, $separator="", $parents="" ){
    global $post, $wp_rewrite;
    if( $post->post_type == EM_POST_TYPE_EVENT ){
        $EM_Event = em_get_event($post);
        $categories = $EM_Event->get_categories();
        if( empty($categories) ) return '';

Can anyone help me fix it?

  • This topic was modified 3 hours, 7 minutes ago by evqise.

 

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