Don’t think the effort worth it to do it with generating appropriate mysql statements as you can just use three queries, or sort the posts after you have the results of the query with both ways resulting in a mostly readable code. Main reason not to choose the above is if performance is critical.
Another option is to use some different meta field and store some integer value representing the 3 states, but if you are using a plugin that generates the property value status this might be hard work to figure all the place in which the new meta field can be added.
And if you feel like a mysql guru you can probably order by the value of FIND_IN_SET. You will need to figure out which filter to use to override the
query. One pointer is this snippet – https://gist.github.com/mikeschinkel/6402058#file-find-in-set-php but I didn’t inspect that code.
Related Posts:
- WP_Query with “post_title LIKE ‘something%'”?
- Best way to detect if you are in a SINGLE POST page
- compare meta_query in get_posts arguments
- How to do a wp_query using “BETWEEN” with two meta_values?
- Better way to get tag stats?
- Query two taxonomies via URL or link?
- How do I order pages and categories by ID or name in the same query?
- wp_query order by title
- How to do a query only on a specific admin page?
- Sort posts by custom taxonomy name
- How to adjust found_posts so that it accounts for offset and pagination
- SQL query equivalent to WP User Query
- Function to check if author has posted within the last x days
- Wp_query order by multiple custom fields?
- Would this post meta be better added to the post table rather than post_meta table
- Show default content if custom WP_Query has no posts
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- meta_query on a date range using an array of values
- Pagination for custom query on single.php
- Get product list of given category
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- Query Ignoring ‘exclude’ Parameter?
- WordPress query vars are not added
- How to prevent writing duplicate loops?
- merge two query arguments into one WP_Query call
- Adding a parameter to the default query
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Alternative to query->set that appends conditions instead of overriding
- While creating Block Themes in WordPress, how can I query custom posts for an Archive view?
- How To Fix WP Query Returns Results But Shouldn’t?
- why update and delete query not worked in custom table?
- get_users is missing or skipping over users in loop
- Weird orderby => post__in issue
- how to handle multiple ajax wordpress queries?
- problem by deleting new plugin installed inside the WordPress after any heroku app sleeping [closed]
- How to extract specific post
- Adding multiple meta_key fields as orderby options to a WP Query via a function
- wp_Qwery works to slow
- Search for “2nd” also returns “22nd” in wp_query
- 2 weeks ago from meta query meta value
- Running main loop 2 times with conditional statement
- paged variable not working for category/custom post archive
- How to output the title of the blogs home page
- Get posts by list of post IDs ordered by those IDs?
- Array as ‘key’ in WP_Query
- Reset WordPress Post Query to default
- Check the Specific Meta Key IF its Meta Value is Empty then… (WP Post Meta Query)
- Woocommerce – exclude only older out-of-stock items
- Searching for meta_key returns 0 posts
- Using custom taxonomies in a query
- ACF accessing a field from the query, but not in post
- What is the best way (regarding performance) to set transients for logged in users?
- List of ways to access WordPress database?
- Determining Author post count
- Is there a ‘compare’ option when using WP_Query apart from meta_query
- WP_Query returns different results from get_posts() [closed]
- How to pass query string vars between admin pages?
- Query posts by Post title
- Differentiate Nested WP_Query from Parent
- WP_User_Query and user posts
- Why do I have to use pre_get_posts with custom WP_Query to reset posts_per_page?
- WP order ASC in custom author loop
- Custom Homepage Pagination using WP_Query
- My website is getting too many dierect home arechives and this is increasing my bounce rate
- Get list of all Grandchild Pages
- get latest added term from taxonomy and insert into php variable
- Featured images loop for Orbit Slider
- Posts limit on homepage (genesis framework)
- Trouble passing attribute into shortcode function
- WP_Query return posts in wrong order
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- WordPress search WP_Query to cover multiple post types and their custom fields?
- How do i create a custom post query when the meta value is an array?
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- How to use jQuery validation to set the search bar to accept only a specific input?
- Very slow query generated getting meta data from posts
- How to compare between two dates in a nested loop?
- How to query 5 users in random who have published more than 10 posts
- Limit default Search query to post_title
- Order & Orderby clause not working with custom query
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- How to redirect a query string to a “virtual” subdirectory
- WP_Query returns images but post_per_page is incorrect
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Select posts wich has no relationship in custom taxonomy
- WordPress Query posts that have title > another title
- WordPress WP_Query offset parameter not working with search parameter
- Custom post type archive organized by category
- Adding page subdirectory dynamically, as like buddypress does
- orderby in WP_query doesn’t works
- Displaying content to search engines but via navigation only for registered users.
- Duplicate posts showing up in loop using infinite scroll
- WP_Query orderby not working on custom post_type
- wp_query->set for several categories
- Getting posts via WP Query
- Print post data inside loop using theme content template
- Where to find WP_Query class?
- WP_Query with tax_query not working
- How to know which editor published a post programmatically?