Event_Sources_Collection::POST_TYPE, 'meta_key' => '_event_bridge_for_activitypub_accept_of_follow', 'meta_query' => array( array( 'key' => '_event_bridge_for_activitypub_accept_of_follow', 'value' => $id, 'compare' => '=', ), ), ); $query = new \WP_Query( $args ); // If no event source with that accept ID is found return. if ( ! $query->have_posts ) { return; } $post = $query->get_posts()[0]; $post_id = is_a( $post, 'WP_Post' ) ? $post->ID : $post; \delete_post_meta( $post_id, '_event_bridge_for_activitypub_accept_of_follow' ); } }