New answers tagged

0

You can use array_map like this: $room_types = isset( $_POST['room_types'] ) ? (array) $_POST['room_types'] : array(); $room_types = array_map( 'esc_attr', $room_types ); // Replace esc_attr with your desire sanitization


1

You shouldn't be using WP_Query at all. The standard loop will automatically display the correct posts. while ( have_posts() ) : the_post(); endwhile;


-1

You can use get_queried_object(), within that object you can get the slug or id.


Top 50 recent answers are included