Skip to content

Content query: sync the fixes from the core PR review - #1123

Merged
dkotter merged 5 commits into
developfrom
update/content-query-core-review
Oct 6, 2026
Merged

dkotter merged 5 commits into
developfrom
update/content-query-core-review

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to WordPress/wordpress-develop#12195.

Brings the fixes from the review of the core core/content-query PR to the plugin's copy of the ability.

Why?

The plugin's Content class is kept almost identical to core's WP_Content_Abilities, so both copies should get the same fixes.

How?

  • The "This filter is documented in" references sit directly above their apply_filters() calls, without a trailing period. The NonPrefixedHooknameFound ignores move to the end of the apply_filters() lines.
  • The count query in get_query_total() unsets no_found_rows, so it can't skip the count it exists for. The main query doesn't set it today, so this is defensive.
  • Comments that span more than one line use the /* */ format.
  • ContentTest no longer pops the faked abilities init actions in try/finally blocks, since WP_UnitTestCase restores $wp_current_filter in tear_down().
  • The class docblock drops the note that core's class is still static. Core's class is final and instance-based now, like the plugin's.

Left out are the core-only test changes (Trac @ticket tags, REST controller test messages, relying on core's per-test post type reset) and the public meta flag, which is a separate change.

Use of AI Tools

Ported from the core PR with AI assistance (Claude Code) and reviewed by me.

Testing Instructions

Run the content ability tests:

npm run test:php -- --filter ContentTest

Changelog Entry

Developer - Sync the core/content-query ability with the fixes from its core review.

Open WordPress Playground Preview

Move each NonPrefixedHooknameFound ignore onto its apply_filters() line,
so the "documented in" reference sits right above the call, and drop the
reference's trailing period, matching core's convention.
WP_UnitTestCase restores $wp_current_filter in tear_down(), so the
faked abilities init actions don't need a try/finally to pop them.
Comments that span more than one line use the /* */ format, per the
WordPress PHP documentation standards.
The count query exists to read found_posts, which WP_Query skips when
no_found_rows is set, so make sure it never inherits that argument.
Core's WP_Content_Abilities is now final and instance-based with private
helpers as well (WordPress/wordpress-develop#12195),
so the class structure is no longer a difference from core.
@jorgefilipecosta
jorgefilipecosta requested a review from a team October 6, 2026 14:09
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.62%. Comparing base (2cc9603) to head (8f6208f).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1123   +/-   ##
==========================================
  Coverage      81.62%   81.62%           
  Complexity      3088     3088           
==========================================
  Files            129      129           
  Lines          12297    12297           
==========================================
  Hits           10037    10037           
  Misses          2260     2260           
Flag Coverage Δ
unit 81.62% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter dkotter added this to the 1.5.0 milestone Oct 6, 2026
@dkotter
dkotter merged commit e120e2c into develop Oct 6, 2026
36 checks passed
@dkotter
dkotter deleted the update/content-query-core-review branch October 6, 2026 15:11
muneeb-ashraf added a commit to muneeb-ashraf/ai that referenced this pull request Oct 7, 2026
Matches the `core/content-query` changes in WordPress#1122 and WordPress#1123: set the
`public` meta flag added in WordPress 7.1, and write multi-line comments
as block comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants