get_col( $wpdb->prepare( "SELECT post_id FROM {$wpdb->prefix}gatherpress_events WHERE datetime_end < %s", $ended_before_time_string ) ); return $results; } /** * Init function. */ public static function init() { \add_filter( 'gatherpress_force_online_event_link', function ( $force_online_event_link ) { // Get the current post object. $post = get_post(); // Check if we are in a valid context and the post type is 'gatherpress'. if ( $post && 'gatherpress_event' === $post->post_type ) { // Add your custom logic here to decide whether to force the link. // For example, force it only if a specific meta field exists. if ( get_post_meta( $post->ID, 'event_bridge_for_activitypub_is_cached', true ) ) { return true; // Force the online event link. } } return $force_online_event_link; // Default behavior. }, 10, 1 ); } }