Repository navigation
Content query: sync the fixes from the core PR review - #1123
Conversation
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.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
What?
Follow up to WordPress/wordpress-develop#12195.
Brings the fixes from the review of the core
core/content-queryPR to the plugin's copy of the ability.Why?
The plugin's
Contentclass is kept almost identical to core'sWP_Content_Abilities, so both copies should get the same fixes.How?
apply_filters()calls, without a trailing period. TheNonPrefixedHooknameFoundignores move to the end of theapply_filters()lines.get_query_total()unsetsno_found_rows, so it can't skip the count it exists for. The main query doesn't set it today, so this is defensive./* */format.ContentTestno longer pops the faked abilities init actions intry/finallyblocks, sinceWP_UnitTestCaserestores$wp_current_filterintear_down().Left out are the core-only test changes (Trac
@tickettags, REST controller test messages, relying on core's per-test post type reset) and thepublicmeta 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:
Changelog Entry