Skip to content

Commit 73209c2

Browse files
committed
Merge branch 'trunk' into feature/derive-pagination
2 parents 0e94613 + b7d946b commit 73209c2

File tree

7 files changed

+24
-27
lines changed

7 files changed

+24
-27
lines changed

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Advanced Query Loop
44
* Description: Query loop block variations to create custom queries.
55
* Plugin URI: https://github.com/ryanwelcher/advanced-query-loop/
6-
* Version: 4.0.0
6+
* Version: 4.0.2
77
* Requires at least: 6.2
88
* Requires PHP: 7.4
99
* Author: Ryan Welcher

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "advanced-query-loop",
3-
"version": "4.0.0",
3+
"version": "4.0.2",
44
"description": "Query loop block variations to create custom queries.",
55
"main": "index.js",
66
"scripts": {

readme.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ Built complicated taxonomy queries!
2020

2121
Select additional post types for your query!
2222

23-
#### Post Count
24-
25-
Set the number of items you want to display (up to 50).
26-
2723
#### Include Posts
2824

2925
Choose the posts you want to display manually or only the children of the current content.
@@ -34,11 +30,7 @@ Remove the current post from the query.
3430

3531
#### Exclude posts by category
3632

37-
Choose to exclude posts from a list of categories
38-
39-
#### Offset
40-
41-
Choose whether you want to start at the first or 100th!
33+
Choose to exclude posts from a list of categories.
4234

4335
#### Post Meta Query
4436

@@ -67,7 +59,7 @@ Sort in ascending or descending order by:
6759

6860
#### Disable Pagination
6961

70-
Improve the performance of the query by disabling pagination
62+
Improve the performance of the query by disabling pagination.
7163

7264
## Extending AQL
7365

readme.txt

+10-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: welcher
33
Tags: Query Loop, Custom Queries
44
Requires at least: 6.2
55
Tested up to: 6.7.1
6-
Stable tag: 4.0.0
6+
Stable tag: 4.0.2
77
Requires PHP: 7.4
88
License: GPL v2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -26,10 +26,6 @@ Built complicated taxonomy queries!
2626

2727
Select additional post types for your query!
2828

29-
==== Post Count ====
30-
31-
Set the number of items you want to display (up to 50).
32-
3329
==== Include Posts ====
3430

3531
Choose the posts you want to display manually or only the children of the current content.
@@ -40,11 +36,7 @@ Remove the current post from the query.
4036

4137
==== Exclude posts by category ====
4238

43-
Choose to exclude posts from a list of categories
44-
45-
==== Offset ====
46-
47-
Choose whether you want to start at the first or 100th!
39+
Choose to exclude posts from a list of categories.
4840

4941
==== Post Meta Query ====
5042

@@ -73,7 +65,7 @@ Sort in ascending or descending order by:
7365

7466
==== Disable Pagination ====
7567

76-
Improve the performance of the query by disabling pagination
68+
Improve the performance of the query by disabling pagination.
7769

7870
== Screenshots ==
7971

@@ -82,6 +74,13 @@ Improve the performance of the query by disabling pagination
8274
3. Query posts before a date, after a date or between two dates.
8375

8476
== Changelog ==
77+
78+
= 4.0.2=
79+
* Bug fixes
80+
81+
= 4.0.1 =
82+
* A few small bug fixes courtesy of @gvgvgvijayan
83+
8584
= 4.0.0 =
8685
* Introducing the new Taxonomy Builder!
8786
* Show children of current item only.

src/components/post-include-controls.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export const PostIncludeControls = ( { attributes, setAttributes } ) => {
8888
return <div>{ __( 'Loading…', 'advanced-query-loop' ) }</div>;
8989
}
9090

91+
// If the first post in the posts array does not have a title, don't render the component.
92+
if ( posts.length > 0 && ! posts[ 0 ].title ) {
93+
return null;
94+
}
95+
9196
return (
9297
<>
9398
<h2> { __( 'Include Posts', 'advanced-query-loop' ) }</h2>
@@ -101,7 +106,9 @@ export const PostIncludeControls = ( { attributes, setAttributes } ) => {
101106
<FormTokenField
102107
label={ __( 'Posts', 'advanced-query-loop' ) }
103108
value={ includePosts.map( ( item ) => item.title ) }
104-
suggestions={ posts.map( ( post ) => post.title.rendered ) }
109+
suggestions={ posts.map(
110+
( post ) => post?.title?.rendered
111+
) } // Need to fix this here. Posts might not have title.rendered
105112
onInputChange={ ( searchPost ) =>
106113
setSearchArg( searchPost )
107114
}

src/components/post-order-controls.js

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export const PostOrderControls = ( { attributes, setAttributes } ) => {
9090
__nextHasNoMarginBottom
9191
/>
9292
<ToggleControl
93-
__nextHasNoMarginBottom
9493
label={ __( 'Ascending Order', 'advanced-query-loop' ) }
9594
checked={ order === 'asc' }
9695
onChange={ () => {

src/variations/controls.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ const isAdvancedQueryLoop = ( props ) => {
4646
const withAdvancedQueryControls = ( BlockEdit ) => ( props ) => {
4747
// If the is the correct variation, add the custom controls.
4848
if ( isAdvancedQueryLoop( props ) ) {
49-
// If the inherit prop is false, add all the controls.
49+
// If the inherit prop is false or undefined, add all the controls.
5050
const { attributes } = props;
51-
if ( attributes.query.inherit === false ) {
51+
if ( ! attributes.query.inherit ) {
5252
return (
5353
<>
5454
<BlockEdit { ...props } />

0 commit comments

Comments
 (0)