One option is to use PHP function empty() and the AND / && operator to build your if check to be certain that all of the required parameters are present.
if (
! empty( $type_search ) &&
! empty( $area_search ) &&
! empty( $prezzo_search ) &&
) {
// your ocde
}
P.s. type and area could be an excellent opportunity to use custom taxonomies and terms instead of post meta, if they can only have one or more predifned values and they are used to group posts together. Using custom taxonomies can provide you better performance, more on this for example here, https://tomjn.com/2016/12/05/post-meta-abuse/ (not written by me).
Related Posts:
- the_date() not working
- Query multiple custom post types in single loop
- The correct method to pass query vars in AJAX using ajaxurl
- wpdb::prepare was called incorrectly
- Using WP_Query – how to display something IF there are no results
- How to order WP_User_Query results to match the order of an array of user IDs?
- Alter query on edit.php
- How to find objects by terms
- How to create a WP_Query to search the Title or Tag?
- Delete post revisions on post publish
- How to get user by display_name with WP_User_Query
- How to sort results from a custom database table
- Use two WP Query in template
- my function doesn’t return my post from today
- Display related products with custom output
- spliting posts into two columns
- How to get to a specific position in wp_query?
- WordPress – query 5 posts with a specific post in top
- Multiple choice in a custom taxonomy
- Get all user meta by meta key instead of ID
- How to get a list of all possible values of a specific user meta key?
- Get stock by custom meta field on all Woocommerce variable products
- Any possible way to make $wpdb->get_results() return anything else than array?
- Accessing the database from a plugin outside of action hooks
- Echo a hierarchical list of post data from custom fields
- WP Query with custom Shortcode
- Storing Array from returned database query and using the array in a new query
- mysql query from wordpress page using custom table
- WordPress 3.2 query_posts and pagination, permalinks issue
- only show container with next/prev links if they exist?
- What query string parameter is available for index.php, that works for both pages and blog articles?
- Long running queries
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- How to pre populate a form field with a link of a current user’s author profile?
- Trying to get a PHP variable defined in a custom post into a javascript file. Null value. Using wp_localize_script
- Query if audio attachment AND/OR custom field
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- register_taxonomy() take much queries
- Odd / Even posts add class minus first post
- unable to use ‘new WP_Query’ in AJAX call
- Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]
- How to add div blocks after certain set of post
- How to overwrite orderby with add_query_var
- working with term_relationships table
- WordPress query undefined offset in loop
- Can I make get_users() query global?
- Issue with custom loop in Archive page
- Parse error: syntax error, unexpected ‘}’ [closed]
- Shortcode to pull posts
- PHP -> SQL Query with Summing
- Querying for specific tags
- How to get thumbnail with pure PHP in a WordPress database?
- Limit tags shown in post
- mySQL queries are executed twice on wordpress website
- Echo array value
- Undefined variable: row?
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- Query pulling a single post per month
- SQL error with custom query
- WordPress is removing query variables like page, p from the URL of a custom static page
- WordPress Conditional / Multiple Taxonomy Query
- How can I modify this code to make the search box include tags and meta
- Advanced Query posts
- How can I check that the acf field value is not a duplicate when adding a post?
- Build A Custom SQL Query for WordPress Search
- My Custom Post Type AJAX Query is Returning no posts – why?
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- Display articles with a different template in the home page | Solved |
- How can i limit the number of posts to the most recent 6 in my query?
- getting the values of hidden inputs to use them in a php mysql query
- Offset with ajax load more posts duplicates
- wordpress query returning unexpected results
- Let user select the number of posts shown per page jquery error
- Query doesn’t display text data with apostrophes
- How to query a staging database?
- How to make a parent page for author.php?
- How can I display a query in a page?
- Include a custom field in mysql query
- Echo multiple tasks if a common function exists
- Get posts associated with media attachment
- How to enqueue assets only on queried pages, excluding the page being queried?
- Check if values exists DB
- Trying to exclude posts from a category on the home page
- Arrange Category post manually when displayed
- The search engine of my website finds only posts and not pages, how can I solve this problem?
- Hide empty categories from get_categories
- Query Concatenation
- wp_query on search results page showing all results every time
- WP_Query not returning results
- Show post like this image in my newssite [closed]
- Can WordPress support Website (19GB database) Should I move Our WordPress Website to a custom one using Laravel or any other PHP framework?
- Sorting a custom post type in pre_get_posts
- Three different queries on same page
- SQL query to retrieve the number of WordPress posts with all given categories
- Exclude a category ID from the following function
- Pre_get_comments and orderby comment_karma
- taxonomy pages returning “NULL” when running default WordPress function ‘get_queried_object()’
- Hot to show custom post type taxonomies on archive page
- How to allow searching a custom meta key in admin list table?