Changeset 64388
- Timestamp:
- 10/16/2026 10:28:45 AM (29 hours ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
src/wp-includes/abilities.php (modified) (5 diffs)
-
src/wp-includes/abilities/class-wp-abilities-content.php (added)
-
src/wp-includes/class-wp-post-type.php (modified) (3 diffs)
-
src/wp-includes/post.php (modified) (4 diffs)
-
tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php (added)
-
tests/phpunit/tests/rest-api/wpRestAbilitiesContentController.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/abilities.php
r64346 r64388 10 10 declare( strict_types = 1 ); 11 11 12 require_once __DIR__ . '/abilities/class-wp-abilities-content.php'; 12 13 require_once __DIR__ . '/abilities/class-wp-abilities-settings.php'; 13 14 require_once __DIR__ . '/abilities/class-wp-abilities-users.php'; … … 17 18 * 18 19 * @since 6.9.0 19 * @since 7.2.0 Added the ` uncategorized` category.20 * @since 7.2.0 Added the `content` and `uncategorized` categories. 20 21 */ 21 22 function wp_register_core_ability_categories(): void { … … 37 38 38 39 wp_register_ability_category( 40 'content', 41 array( 42 'label' => __( 'Content' ), 43 'description' => __( 'Abilities that retrieve or manage posts and other content.' ), 44 ) 45 ); 46 47 wp_register_ability_category( 39 48 'uncategorized', 40 49 array( … … 49 58 * 50 59 * @since 6.9.0 51 * @since 7.2.0 Added the `core/ settings-get`and `core/users-query` abilities.60 * @since 7.2.0 Added the `core/content-query`, `core/settings-get`, and `core/users-query` abilities. 52 61 * 53 62 * @global wpdb $wpdb WordPress database abstraction object. … … 371 380 // Register the user abilities (currently the read-only `core/users-query`). 372 381 ( new WP_Abilities_Users() )->register(); 382 383 // Register the content abilities (currently the read-only `core/content-query`). 384 ( new WP_Abilities_Content() )->register(); 373 385 } -
trunk/src/wp-includes/class-wp-post-type.php
r63541 r64388 373 373 */ 374 374 public $show_in_rest; 375 376 /** 377 * Whether this post type should be exposed through the Abilities API. 378 * 379 * Default false. If true, the core content abilities can access the post type's 380 * posts, subject to the current user's capabilities. 381 * 382 * @since 7.2.0 383 * @var bool $show_in_abilities 384 */ 385 public $show_in_abilities; 375 386 376 387 /** … … 554 565 'delete_with_user' => null, 555 566 'show_in_rest' => false, 567 'show_in_abilities' => false, 556 568 'rest_base' => false, 557 569 'rest_namespace' => false, … … 583 595 $args['rest_namespace'] = 'wp/v2'; 584 596 } 597 598 // Only `true` exposes the post type, so other values, such as arrays, can be given a meaning later. 599 $args['show_in_abilities'] = true === $args['show_in_abilities']; 585 600 586 601 // If not set, default to the setting for 'show_ui'. -
trunk/src/wp-includes/post.php
r64245 r64388 51 51 ), 52 52 'show_in_rest' => true, 53 'show_in_abilities' => true, 53 54 'rest_base' => 'posts', 54 55 'rest_controller_class' => 'WP_REST_Posts_Controller', … … 85 86 ), 86 87 'show_in_rest' => true, 88 'show_in_abilities' => true, 87 89 'rest_base' => 'pages', 88 90 'rest_controller_class' => 'WP_REST_Posts_Controller', … … 1692 1694 * @since 5.3.0 The `supports` argument will now accept an array of arguments for a feature. 1693 1695 * @since 5.9.0 The `rest_namespace` argument was added. 1696 * @since 7.2.0 The `show_in_abilities` argument was added. 1694 1697 * 1695 1698 * @global array $wp_post_types List of post types. … … 1737 1740 * @type bool $show_in_rest Whether to include the post type in the REST API. Set this to true 1738 1741 * for the post type to be available in the block editor. 1742 * @type bool $show_in_abilities Whether to expose this post type through the Abilities API, so the 1743 * core content abilities can access its posts, subject to the current 1744 * user's capabilities. Default false. 1739 1745 * @type string $rest_base To change the base URL of REST API route. Default is $post_type. 1740 1746 * @type string $rest_namespace To change the namespace URL of REST API route. Default is wp/v2.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)