Skip to content

Rename the settings ability to core/settings-get - #1087

Merged
dkotter merged 1 commit into
developfrom
update/rename-settings-get-ability
Oct 5, 2026
Merged

dkotter merged 1 commit into
developfrom
update/rename-settings-get-ability

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #1002.

Renames the settings ability so its name puts the object first, like the other core abilities:

  • core/read-settings is now core/settings-get

Why?

#1002 renamed core/read-content and core/read-users to core/content-query and core/users-query. That left core/read-settings as the only core ability still named read-*. The settings ability returns a single map of setting values rather than a list of items, so "get" describes it better than "query".

How?

Rename:

  • The ability registration, unregister guard, label, and docblocks use the new name. The label is now "Settings Get", in line with "Content Query" and "Users Query".
  • The gated wrapper class is renamed to Settings_Get.
  • The Show_In_Abilities docblocks, integration tests, the e2e helper plugin, and the e2e spec follow the new name. The spec file is renamed to core-settings-get.spec.js.
  • Past entries in CHANGELOG.md and readme.txt keep the old name because they describe released versions.

Deprecated alias

The old name keeps working for a few releases:

  • core/read-settings is registered as a deprecated alias with register_deprecated_ability_alias(), the helper added in Rename the content and users abilities and remove ai/get-post-details #1002. The alias copies the label, description, category, schemas, and meta of core/settings-get, and forwards execution and permission checks to it. The description starts with a "Deprecated" note, and the meta carries a deprecated entry with the version and the replacement name.
  • Executing the alias triggers a deprecation notice through _deprecated_function().
  • The alias is marked with a @todo comment for removal after a few releases.

Testing Instructions

  1. Enable the Custom Abilities experiment on the AI settings screen.
  2. Visit /wp-json/wp-abilities/v1/abilities and check that core/settings-get is listed. The old name core/read-settings is still listed, with "(deprecated)" in the label and a deprecated entry in the meta.
  3. Run core/read-settings and confirm it returns the same result as core/settings-get. With WP_DEBUG on, a deprecation notice is logged.
  4. Run the PHP tests:
    npm run test:php -- --filter 'SettingsTest|Gated_AbilitiesTest|Custom_AbilitiesTest'
    
  5. Run the e2e spec:
    npm run test:e2e -- tests/e2e/specs/abilities/core-settings-get.spec.js
    

Changelog Entry

Changed - The core/read-settings ability is renamed to core/settings-get. The old name keeps working as a deprecated alias for now.

Open WordPress Playground Preview

Keep core/read-settings registered as a deprecated alias for a few
releases, the same way #1002 handled the content and users renames.
@jorgefilipecosta
jorgefilipecosta requested a review from a team October 1, 2026 15:28
@github-actions

github-actions Bot commented Oct 1, 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: gziolo <gziolo@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@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 1, 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 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.54%. Comparing base (da700e0) to head (2734238).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1087   +/-   ##
==========================================
  Coverage      81.53%   81.54%           
  Complexity      3071     3071           
==========================================
  Files            129      129           
  Lines          12253    12254    +1     
==========================================
+ Hits            9991     9992    +1     
  Misses          2262     2262           
Flag Coverage Δ
unit 81.54% <100.00%> (+<0.01%) ⬆️

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.

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good and it tests correctly with Abilities Explorer:

Image

@jeffpaul

jeffpaul commented Oct 4, 2026

Copy link
Copy Markdown
Member

@dkotter probably worth pulling into the 1.4.0 release?

@jeffpaul jeffpaul added this to the 1.4.0 milestone Oct 4, 2026
@dkotter
dkotter merged commit 04e09f0 into develop Oct 5, 2026
37 checks passed
@dkotter
dkotter deleted the update/rename-settings-get-ability branch October 5, 2026 13:24
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Oct 5, 2026
muneeb-ashraf added a commit to muneeb-ashraf/ai that referenced this pull request Oct 6, 2026
Resolves the Gated_AbilitiesTest import conflict from the
`core/settings-get` rename (WordPress#1087).

Also marks Terms_Query as depending on core-object exposure, since
`core/terms-query` now reads the `show_in_abilities` flag that
Show_In_Abilities sets on `category` and `post_tag`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 6, 2026
…-get.

Syncs the core PR with the WordPress/ai plugin, where the ability was
renamed in WordPress/ai#1087. Renames the ability,
its label (Read Settings -> Settings Get), the docblock references in
option.php and abilities.php, the test file, its test methods, and the
custom test option.
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 6, 2026
…-get.

Syncs the core PR with the WordPress/ai plugin, where the ability was
renamed in WordPress/ai#1087. Renames the ability,
its label (Read Settings -> Settings Get), the docblock references in
option.php and abilities.php, the test file, its test methods, and the
custom test option.
jorgefilipecosta added a commit that referenced this pull request Oct 6, 2026
This reverts commit bbc9c19.

Keep "Settings Get" and "Settings Update", in line with the plugin's
other object-first abilities, such as "Content Query" and "Users Query",
since #1087. The core port keeps the
same label.
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 6, 2026
This reverts commit 7f149df.

The AI plugin labels the ability "Settings Get", in line with its other
object-first abilities, since WordPress/ai#1087,
which this PR carries over.
jorgefilipecosta added a commit that referenced this pull request Oct 6, 2026
This reverts commit bbc9c19.

Keep "Settings Get" and "Settings Update", in line with the plugin's
other object-first abilities, such as "Content Query" and "Users Query",
since #1087. The core port keeps the
same label.
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 8, 2026
…-get.

Syncs the core PR with the WordPress/ai plugin, where the ability was
renamed in WordPress/ai#1087. Renames the ability,
its label (Read Settings -> Settings Get), the docblock references in
option.php and abilities.php, the test file, its test methods, and the
custom test option.
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 8, 2026
This reverts commit 7f149df.

The AI plugin labels the ability "Settings Get", in line with its other
object-first abilities, since WordPress/ai#1087,
which this PR carries over.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

Sponsor
SponsoredKunjungi sekarang
Promo