You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8be2862
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Add option to exclude current post from query block (WordPress#64916)
* feat: add compatability filter for query block to exclude current post
* feat: add exclude current option to query block filters area
* fix: hide excludeCurrent filter or enable by default based on context, use post type label
* Add backport changelog
* Query Block: Guard against falsy current post ID when excluding
Simplify the post__not_in append and skip it when get_the_ID() returns
a falsy value (e.g. outside the loop), matching the JS-side guard in
post-template/edit.js that requires a truthy postId before excluding.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Query Block: Simplify excludeCurrent condition with ! empty()
Align the server-side filter with the core PR (WordPress/wordpress-develop#12016),
which uses ! empty() instead of an isset() + truthy check. Functionally identical
but matches core's simplified form.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Query Block: Do not auto-enable excludeCurrent on mount
Keep the query filters clean when the block mounts instead of forcing
`excludeCurrent` to true in singular templates. Enabling the exclusion is
now left to the user via the toggle; the effect only clears a stale value
when the exclusion no longer applies.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Unlinked contributors: noellesteegs, chrisgresh.
Co-authored-by: g-elwell <garethelwell@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: spacedmonkey <spacedmonkey@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: ryanwelcher <welcher@git.wordpress.org>
Co-authored-by: Marc-pi <mdxfr@git.wordpress.org>
Co-authored-by: mrfoxtalbot <mrfoxtalbot@git.wordpress.org>
Co-authored-by: carlomanf <manfcarlo@git.wordpress.org>
Co-authored-by: bbertucc <elblakeo31@git.wordpress.org>
Co-authored-by: supernovia <supernovia@git.wordpress.org>
Co-authored-by: dinhtungdu <dinhtungdu@git.wordpress.org>
Co-authored-by: lunule <lunule@git.wordpress.org>
Co-authored-by: efu98 <elfu98@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: colinduwe <colind@git.wordpress.org>
Co-authored-by: Humanify-nl <humanify@git.wordpress.org>
0 commit comments