Changeset 61068
- Timestamp:
- 10/27/2025 09:06:15 AM (7 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/wp-includes/abilities/wp-core-abilities.php (modified) (3 diffs)
-
src/wp-settings.php (modified) (1 diff)
-
tests/phpunit/tests/abilities-api/wpCoreAbilities.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/abilities/wp-core-abilities.php
r61063 r61068 9 9 10 10 declare( strict_types = 1 ); 11 11 12 /** 12 13 * Registers the core ability categories. … … 45 46 $category_user = 'user'; 46 47 47 $site_info_fields = array( 48 'name', 49 'description', 50 'url', 51 'wpurl', 52 'admin_email', 53 'charset', 54 'language', 55 'version', 56 ); 48 $site_info_properties = array( 49 'name' => array( 50 'type' => 'string', 51 'description' => __( 'The site title.' ), 52 ), 53 'description' => array( 54 'type' => 'string', 55 'description' => __( 'The site tagline.' ), 56 ), 57 'url' => array( 58 'type' => 'string', 59 'description' => __( 'The site home URL.' ), 60 ), 61 'wpurl' => array( 62 'type' => 'string', 63 'description' => __( 'The WordPress installation URL.' ), 64 ), 65 'admin_email' => array( 66 'type' => 'string', 67 'description' => __( 'The site administrator email address.' ), 68 ), 69 'charset' => array( 70 'type' => 'string', 71 'description' => __( 'The site character encoding.' ), 72 ), 73 'language' => array( 74 'type' => 'string', 75 'description' => __( 'The site language locale code.' ), 76 ), 77 'version' => array( 78 'type' => 'string', 79 'description' => __( 'The WordPress version.' ), 80 ), 81 ); 82 $site_info_fields = array_keys( $site_info_properties ); 57 83 58 84 wp_register_ability( … … 79 105 'output_schema' => array( 80 106 'type' => 'object', 81 'properties' => array( 82 'name' => array( 83 'type' => 'string', 84 'description' => __( 'The site title.' ), 85 ), 86 'description' => array( 87 'type' => 'string', 88 'description' => __( 'The site tagline.' ), 89 ), 90 'url' => array( 91 'type' => 'string', 92 'description' => __( 'The site home URL.' ), 93 ), 94 'wpurl' => array( 95 'type' => 'string', 96 'description' => __( 'The WordPress installation URL.' ), 97 ), 98 'admin_email' => array( 99 'type' => 'string', 100 'description' => __( 'The site administrator email address.' ), 101 ), 102 'charset' => array( 103 'type' => 'string', 104 'description' => __( 'The site character encoding.' ), 105 ), 106 'language' => array( 107 'type' => 'string', 108 'description' => __( 'The site language locale code.' ), 109 ), 110 'version' => array( 111 'type' => 'string', 112 'description' => __( 'The WordPress version.' ), 113 ), 114 ), 107 'properties' => $site_info_properties, 115 108 'additionalProperties' => false, 116 109 ), -
trunk/src/wp-settings.php
r61063 r61068 291 291 require ABSPATH . WPINC . '/abilities-api/class-wp-abilities-registry.php'; 292 292 require ABSPATH . WPINC . '/abilities-api.php'; 293 require ABSPATH . WPINC . '/abilities /wp-core-abilities.php';293 require ABSPATH . WPINC . '/abilities.php'; 294 294 require ABSPATH . WPINC . '/rest-api.php'; 295 295 require ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php'; -
trunk/tests/phpunit/tests/abilities-api/wpCoreAbilities.php
r61063 r61068 6 6 * Tests for the core abilities shipped with the Abilities API. 7 7 * 8 * @covers wp_register_core_ability_categories 9 * @covers wp_register_core_abilities 10 * 8 11 * @group abilities-api 9 12 */ 10 class Tests_Abilities_API_Wp CoreAbilities extends WP_UnitTestCase {13 class Tests_Abilities_API_WpRegisterCoreAbilities extends WP_UnitTestCase { 11 14 12 15 /** … … 28 31 do_action( 'wp_abilities_api_categories_init' ); 29 32 do_action( 'wp_abilities_api_init' ); 33 } 30 34 35 /** 36 * Tear down after the class. 37 * 38 * @since 6.9.0 39 */ 40 public static function tear_down_after_class(): void { 31 41 // Re-add the unhook functions for subsequent tests. 32 42 add_action( 'wp_abilities_api_categories_init', '_unhook_core_ability_categories_registration', 1 ); 33 43 add_action( 'wp_abilities_api_init', '_unhook_core_abilities_registration', 1 ); 44 45 // Remove the core abilities and their categories. 46 foreach ( wp_get_abilities() as $ability ) { 47 wp_unregister_ability( $ability->get_name() ); 48 } 49 foreach ( wp_get_ability_categories() as $ability_category ) { 50 wp_unregister_ability_category( $ability_category->get_slug() ); 51 } 52 53 parent::tear_down_after_class(); 34 54 } 35 55
Note: See TracChangeset
for help on using the changeset viewer.