• When I go to the 404 page, I get this Notice:

    Notice: Trying to get property of non-object in /var/www/web/wp-content/plugins/conditional-menus/init.php on line 271

    To solve it, I added a “bail early” at the top of the function:

    public function check_visibility( $logic ) {
    		$visible = true;
    		parse_str( $logic, $logic );
    		$query_object = get_queried_object();
    
    		if (is_null($query_object)) {
    			return false; // bail early.
    		}
    • This topic was modified 8 years, 6 months ago by ferranmartin.
  • The topic ‘PHP Notice on 404 page’ is closed to new replies.