C:\Program Files\JetBrains
public static function get_previous_normal_post( int $current_post_id = null ) {
$current_post_id = ( $current_post_id === null ) ?? get_the_ID();
$query = new WP_Query( [
'posts_per_page' => - 1,
'post_type' => 'projects',
'post_status' => 'publish',
'meta_query' => [
'relation' => 'AND',
'type' => [
'key' => 'type',
'value' => [ 'archive', 'commin_soon' ],
],
],
'post__not_in' => [ $current_post_id ],
] );
wp_reset_postdata();
$post_ids = wp_list_pluck( $query->posts, 'ID' );
print_r(get_previous_post( false, implode( ',', $post_ids ) ));
}
<input type="text" required oninvalid="this.setCustomValidity('Wow!')">