Skip to content

Commit

Permalink
[FEATURE] Adds Query Include/Exclude Package
Browse files Browse the repository at this point in the history
Change Details
-------------
A project suggested it would be great to have the ability to specify
which posts are included or excluded from a query-loop block. This
package aims to provide this feature. The functionality already exists
in core, but there's no interface to control it. At the moment this
package provides a simple interface.

Further enhancements could be acheievd in the future, such as limiting
the number of selectable posts to include to the same limit as the query
and only returning posts that meet other filters selected in the query
for the include/exclude.

Also, there's potential performance issues if the number of posts or pages
is excessive so we could look at more lazily loading these.
  • Loading branch information
jdamner committed Jul 15, 2024
1 parent 8e1fa1f commit 68cac14
Show file tree
Hide file tree
Showing 11 changed files with 1,143 additions and 615 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
target_repo: "wp-editor-tools"
- local_path: "iconography"
target_repo: "wp-iconography"
- local_path: "query-include-exclude"
target_repo: "wp-query-include-exclude"

steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
}
],
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wordpress/sqlite-database-integration.git"
},
{
"only": [
"wpackagist-plugin/*",
"wpackagist-theme/*"
],
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "vcs",
"url": "https://github.com/wordpress/sqlite-database-integration.git"
}
],
"require": {
Expand All @@ -37,13 +37,14 @@
"require-dev": {
"10up/wp_mock": "^1.0",
"automattic/vipwpcs": "^3.0",
"composer/installers": "^2.2",
"permafrost-dev/coverage-check": "^2.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"symplify/monorepo-builder": "^11.2",
"szepeviktor/phpstan-wordpress": "^1.3",
"wordpress/sqlite-database-integration": "^2.0",
"wpackagist-theme/twentytwentyfour": "^1.0",
"composer/installers": "^2.2"
"wpackagist-plugin/sqlite-database-integration": "^2.0",
"wpackagist-theme/twentytwentyfour": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -58,6 +59,7 @@
}
},
"replace": {
"boxuk/query-include-exclude": "self.version",
"boxuk/wp-editor-tools": "self.version",
"boxuk/wp-iconography": "self.version"
},
Expand Down
Loading

0 comments on commit 68cac14

Please sign in to comment.