Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#64146 closed enhancement (fixed)

Abilities API: Add the initial core abilities and categories registration.

Reported by: jorgefilipecosta's profile jorgefilipecosta Owned by: jorgefilipecosta's profile jorgefilipecosta
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: AI Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Ticket to track the addition of initial default core abiltiies into the core.
They were proposed at https://github.com/WordPress/abilities-api/pull/108 with improvements in preparation for core at https://github.com/WordPress/abilities-api/pull/128.

Change History (10)

This ticket was mentioned in PR #10411 on WordPress/wordpress-develop by @jorgefilipecosta.


6 months ago
#1

  • Keywords has-unit-tests added

Trac ticket: https://core.trac.wordpress.org/ticket/64146

Backports the initial WordPress core abilities proposed at https://github.com/WordPress/abilities-api/pull/108 with improvements in preparation for core at https://github.com/WordPress/abilities-api/pull/128, into Core WordPress.

## Testing
Verify the unit tests are passing.
Loaded the block editor, oppened the browser console, exectuted the following two calls:

wp.apiFetch({ path: wp.url.addQueryArgs('/wp-abilities/v1/abilities/core/get-site-info/run' ) } ).then(console.log);
wp.apiFetch({ path: wp.url.addQueryArgs('/wp-abilities/v1/abilities/core/get-site-info/run', {input: {fields: ['name','url' ] } } ) } ).then(console.log);

Verified things returned as expected.

#2 @jorgefilipecosta
6 months ago

  • Owner set to jorgefilipecosta
  • Resolution set to fixed
  • Status changed from new to closed

In 61063:

Abilities API: Include initial core abilities and categories registration.

Without this patch we would introduce the Abilities API without any core abilities being registered.
This patch includes the following initial abilities:

  • core/get-bloginfo - Retrieve individual site information fields (name, description, url, wpurl, admin_email, charset, language, version).
  • core/get-current-user-info - Get current authenticated user data (id, display_name, user_nicename, user_login, roles, locale).
  • core/get-environment-type - Get WordPress environment type (production, staging, development, local).

Developed in #10411.

Follow-up [64098].

Props gziolo, jorgefilipecosta, mukesh27, isotropic, jorbin, justlevine, jason_the_adams.
Fixes #64146.

#4 @gziolo
6 months ago

  • Component changed from General to AI

#5 @gziolo
6 months ago

In 61068:

Abilities API: Refactor registration for core abilities

Renames the files and adds a test cleanup so it doesn't accidentaly influence the rest of other tests.

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

Follow-up [61063].
See #64146.

#6 @gziolo
6 months ago

In 61069:

Abilities API: Rename files with registration for core abilities

It looks like npm run grunt patch: didn't pick up renaming part ...

Follow-up [61068].
See #64146.

#8 @jorgefilipecosta
6 months ago

Thank you for these follow ups @gziolo!

#9 @gziolo
6 months ago

I didn't want to bother you with nitpicks. When I renamed the test class name, these core abilities failed one of the REST API tests.

#10 @westonruter
6 months ago

In 61075:

Coding Standards: Align equals sign with surrounding assignments.

Fixes Generic.Formatting.MultipleStatementAlignment.NotSameWarning issue in PHPCS.

Follow-up to [61068], [61069].
See #64146.

Note: See TracTickets for help on using tickets.