On top of my head this should be something like:
'meta_query' => [
'key' => '_EventEndDate',
'value' => [ $start, $end ],
'compare' => 'BETWEEN',
'type' => 'DATETIME'
]
You would need to calculate boundaries yourself before passing to the query in this case.
See Custom Field Parameters in Codex for full documentation on parameters available for meta queries.
Related Posts:
- How to do a meta query using REST-API in WordPress 4.7+?
- Get result from meta_query() between two numbers
- Query between two meta keys
- Archives for custom post type based on a “date” meta value
- How to check a single number value against an array of meta_key values?
- get_users meta_query
- Meta query with multiple logic (AND / OR)
- meta_query with multiple values
- Return posts with specific meta key first, but the rest in alpha order by last name
- meta_query key value from array
- Multiple Values stored as array in Meta Query
- Order by nested named meta queries with ‘exists’ and ‘not exists’
- Advanced orderby with multiple meta_query
- Using get_terms() with meta_query parameters
- WP_User_Query with meta_query array relation ‘OR’
- meta_query problem
- Very slow query with meta_query on large database
- How to exlude posts that have certain meta_value?
- User Relationship
- meta_query results not the same with and without spaces
- meta_query all posts between to ages
- WordPress Core – Optimizing meta_query generated SQL?
- Edit post_content on posts with Featured Image
- Nested Queries using meta_query
- Display no post when metavalue is 0
- Wildcard with LIKE operator in Meta query
- meta_query, number comparison, not quite working as it should
- Meta Query Compare with Date
- Does meta_query working with value paramater higher then 999?
- meta_query keys and sticky posts
- WP_Query ordered by meta_value_num doesn’t fetch posts without this meta field
- Custom post type archive with rand and meta_value
- Comparing a field with several values at once with meta_query
- Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
- How to query post only with different excerpt?
- WP_Query with meta_query no results
- Documentation for post meta
- WP User Query Issues
- How to use meta query for greater than value in array?
- Wp Query custom search by meta query
- Filter posts by meta query?
- WordPress Screwing Up ‘orderby’ => ‘meta_value_num’ in ‘pre_get_posts’
- How to query wp_postmeta table for any specific meta_value?
- User meta query results in PHP notice: only variables should be passed by reference
- Get a single post ID based on an exact match of 1 or more meta values
- wordpress Meta_query between numbers range (not working)
- meta_query with multiple key
- Orderby doesn’t work like expected on custom query
- I would like to have add_post_meta to return the ID instead of true or false
- Order by meta value
- meta query based on month regardless of year
- meta_query in WP_User_Query not working – returns every user, not just users where key & value matches
- meta query or with meta value
- meta_query array in ‘values’ returns an error
- Can I use pre_get_posts to add up values from two different meta_keys?
- get_users with Serialized Custom Meta Value
- Sorting posts by ACF field
- Unable to use meta_query between currency values when value is over 1 million
- latitude/longitude meta_query
- Filtering all posts AND sticky posts through meta_query
- How to cache the results of a query and display the cached results
- Delete all posts with a specific custom field using meta_query
- meta_query Array
- How to send variable to wp meta_query value?
- Issue with user meta_query
- Search for value(s) in meta field for a multi select
- get_user can’t read variable
- How can I create a meta_query with an array of dates?
- How to count items of meta query?
- WordPress meta query with meta serialized data array value
- Reading Content in an Array as it relates to a meta_query
- wordpress meta query with multiple meta condition causing a load on server and slows down the server..!
- Meta_Query with multi select values
- Trouble with calling an imploded variable in an array
- Memory Leak in Processing Large JSON file
- Meta Query returning empty array
- meta_query not filering but meta_key works fine
- Query for user roles and their skills
- Get Posts from Custom Meta Query
- WordPress search between two newmeric values with a custom post type
- like_escape notice when using LIKE in meta query
- meta_query for user ID in array
- Display query post based on two orderby value in wordpress
- WP User Query with meta queries
- WP_Query with UNIX timestamp in meta query
- Querying by meta key and value
- How to compare date in post meta value
- Which Meta Query Compare Method Should I use?
- Sort posts by post views and consider meta key
- Meta query “OR” comparison not working as expected with array
- How to output meta_key in wp_postmeta?
- meta_query and strange orderby behaviour
- Sorting not working with get_posts
- Get_term with meta_query
- WordPress Meta Query very slow with NOT EXISTS comparison
- ACF meta_query field treated as “0” resulting in false negative search when testing ranges
- Is it possible to customize meta query in this way?
- Ordering WP_Query results by second meta_key
- How making a new search box in admin post table working on a specific column
- wp_user_query with meta_value_num for leaderboard