Make WordPress Core

Opened 4 months ago

Closed 3 months ago

#65373 closed enhancement (fixed)

Query Loop Block: Add option to exclude current post

Reported by: wildworks Owned by: wildworks
Priority: normal Milestone: 7.1
Component: Editor Version:
Severity: normal Keywords: gutenberg-merge commit
Cc: Focuses:

Description

Change History (7)

This ticket was mentioned in ​PR #12016 on ​WordPress/wordpress-develop by ​@wildworks.


4 months ago
#1

  • Keywords has-patch has-unit-tests added

## Use of AI Tools

AI assistance: Yes
Tool(s): GitHub Copilot, ChatGPT
Model(s): GPT-5.1
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.

#2 @wildworks
4 months ago

  • Keywords has-patch has-unit-tests removed
  • Milestone Awaiting Review → 7.1
  • Type defect (bug) → enhancement

​@wildworks commented on ​PR #12016:


4 months ago
#3

@westonruter Thanks for the review! I would like to commit this PR after ​the Gutenberg PR is merged.

#4 @westonruter
4 months ago

  • Keywords commit added
  • Owner set to wildworks
  • Status new → assigned

#5 @wildworks
3 months ago

This ticket cannot proceed until the Gutenberg PR (​https://github.com/WordPress/gutenberg/pull/64916) is merged. If the Gutenberg PR is not ready for the 7.1 release, let's punt this ticket to 7.2 accordingly.

​@wildworks commented on ​PR #12016:


3 months ago
#6

I will commit this later as ​https://github.com/WordPress/gutenberg/pull/64916 has been merged.

#7 @wildworks
3 months ago

  • Resolution → fixed
  • Status assigned → closed

In 62707:

Editor: Add excludeCurrent support to the Query Loop block.

Add support for the excludeCurrent property in the Query Loop block's query. When this property is enabled, the post currently being viewed is excluded from the query results. This is useful for showing a list of related posts within a single post template, where the current post itself should not appear. If there is no current post, the query is left unchanged.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/12016

Props westonruter, wildworks.
Fixes #65373.

Note: See TracTickets for help on using tickets.