diff --git a/includes/Traits/Date_Query.php b/includes/Traits/Date_Query.php index 9bd185f..196d502 100644 --- a/includes/Traits/Date_Query.php +++ b/includes/Traits/Date_Query.php @@ -21,8 +21,8 @@ public function process_date_query(): void { $range = $date_query['range'] ?? false; if ( $date_query && $range && ! empty( $range ) ) { $date_queries = $this->process_date_range( $range ); - } else { + $date_queries = array(); $date_relationship = $date_query['relation'] ?? null; $date_primary = $date_query['date_primary'] ?? null; if ( $date_query && $date_relationship && $date_primary ) { diff --git a/index.php b/index.php index 2677ae1..d90368b 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: Advanced Query Loop * Description: Query loop block variations to create custom queries. * Plugin URI: https://github.com/ryanwelcher/advanced-query-loop/ - * Version: 3.0.1 + * Version: 3.1.0 * Requires at least: 6.2 * Requires PHP: 7.4 * Author: Ryan Welcher diff --git a/package.json b/package.json index 8a670ba..1f2c4f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "advanced-query-loop", - "version": "3.0.1", + "version": "3.1.0", "description": "Query loop block variations to create custom queries.", "main": "index.js", "scripts": { diff --git a/readme.md b/readme.md index d6b9c73..298e3dc 100644 --- a/readme.md +++ b/readme.md @@ -38,7 +38,7 @@ Generate complicated post meta queries using an interface that allows you to cre #### Date Query -Query item before a date, after a date or between two dates! +Query items before a date, after a date or between two dates or choose to show the post from the last 1, 3, 6 and 12 months. #### Post Order controls @@ -51,8 +51,9 @@ Sort in ascending or descending order by: - Meta Value - Meta Value Num - Random -- Menu Order ( props to @jvanja ) -- Post ID ( props to @markhowellsmead ) +- Menu Order (props to @jvanja) +- Name (props @philbee) +- Post ID (props to @markhowellsmead) **Please note that this is a slight duplication of the existing sorting controls. They both work interchangeably but it just looks a bit odd in the UI** diff --git a/readme.txt b/readme.txt index 5d2e148..a645467 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: welcher Tags: Query Loop, Custom Queries Requires at least: 6.2 Tested up to: 6.5.2 -Stable tag: 3.0.1 +Stable tag: 3.1.0 Requires PHP: 7.4 License: GPL v2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -39,22 +39,21 @@ Choose whether you want to start at the first or 100th! Generate complicated post meta queries using an interface that allows you to create a query based on `meta_key`, `meta_value` and the `compare` options. Combine multiple queries and determine if they combine results (OR) or narrow them down (AND). ==== Date Query ==== -Query items before a date, after a date or between two dates! +Query items before a date, after a date or between two dates or choose to show the post from the last 1, 3, 6 and 12 months. ==== Post Order controls ==== Sort in ascending or descending order by: - Author -- Comment Count - Date -- Included Posts - Last Modified Date -- Menu Order ( props to @jvanja ) +- Title - Meta Value - Meta Value Num -- Post ID ( props to @markhowellsmead ) - Random -- Title +- Menu Order (props to @jvanja) +- Name (props @philbee) +- Post ID (props to @markhowellsmead) **Please note that this is a slight duplication of the existing sorting controls. They both work interchangeably but it just looks a bit odd in the UI** @@ -65,6 +64,12 @@ Sort in ascending or descending order by: 3. Query posts before a date, after a date or between two dates. == Changelog == += 3.1.0 = +* Add dynamic date ranges to see posts from the last 1, 3, 6 and 12 months. +* Insert a new instance by typing "AQL" or "aql" and pressing enter. +* Adds sorting by Name (props @philbee). +* Bug fixes. + = 3.0.1 = * Addresses some PHP fatal errors caused by type hinting.