Attempt to read property “ID” on array PHP version > 8.0
-
Attempt to read property “ID” on array in /wp-content/plugins/events-manager/em-events.php
$posts = EM_Events::get(array(‘scope’ => ‘future’), false); is the code that makes the error appear?
any help is greatly appreciated
function being effected :
/** * Makes sure we're in "THE Loop", which is determinied by a flag set when the_post() (start) is first called, and when have_posts() (end) returns false. * @param string $data * @return string */ function em_wp_the_title($data, $id = null){ global $post, $wp_query, $EM_Location, $EM_Event; if( empty($post) ) return $data; //fix for any other plugins calling the_content outside the loop //because we're only editing the main title of the page here, we make sure we're in the main query if( is_main_query() && $id == $post->ID ){ $events_page_id = get_option ( 'dbem_events_page' ); $locations_page_id = get_option( 'dbem_locations_page' ); $edit_events_page_id = get_option( 'dbem_edit_events_page' ); $edit_locations_page_id = get_option( 'dbem_edit_locations_page' ); $edit_bookings_page_id = get_option( 'dbem_edit_bookings_page' ); if( !empty($post->ID) && in_array($post->ID, array($events_page_id, $locations_page_id, $edit_events_page_id, $edit_locations_page_id, $edit_bookings_page_id)) ){ if ( $wp_query->in_the_loop ) { return apply_filters('em_wp_the_title', em_content_page_title($data, $id)) ; } }elseif( is_single() && !empty($post->post_type) ){ if( $post->post_type == EM_POST_TYPE_EVENT ){ $EM_Event = em_get_event($post); return apply_filters('em_wp_the_title', $EM_Event->output($data)) ; }elseif( $post->post_type == EM_POST_TYPE_LOCATION ){ $EM_Location = em_get_location($post); return apply_filters('em_wp_the_title', $EM_Location->output($data)) ; } } } return $data; } add_filter ( 'the_title', 'em_wp_the_title',10, 2 );
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Attempt to read property “ID” on array PHP version > 8.0’ is closed to new replies.