Skip to content

Commit 47cc32f

Browse files
committed
Remove instructions annotation and change default for destructive to `false
1 parent 337514b commit 47cc32f

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/wp-includes/abilities-api/class-wp-ability.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ class WP_Ability {
3636
* @var array<string, (bool|string)>
3737
*/
3838
protected static $default_annotations = array(
39-
// Instructions on how to use the ability.
40-
'instructions' => '',
4139
// If true, the ability does not modify its environment.
4240
'readonly' => false,
4341
/*
4442
* If true, the ability may perform destructive updates to its environment.
4543
* If false, the ability performs only additive updates.
4644
*/
47-
'destructive' => true,
45+
'destructive' => false,
4846
/*
4947
* If true, calling the ability repeatedly with the same arguments will have no additional effect
5048
* on its environment.

tests/phpunit/tests/abilities-api/wpAbility.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ public function test_get_merged_annotations_from_meta() {
115115
array_merge(
116116
self::$test_ability_properties['meta']['annotations'],
117117
array(
118-
'instructions' => '',
119118
'idempotent' => false,
120119
)
121120
),
@@ -136,9 +135,8 @@ public function test_get_default_annotations_from_meta() {
136135

137136
$this->assertSame(
138137
array(
139-
'instructions' => '',
140138
'readonly' => false,
141-
'destructive' => true,
139+
'destructive' => false,
142140
'idempotent' => false,
143141
),
144142
$ability->get_meta_item( 'annotations' )
@@ -152,7 +150,6 @@ public function test_get_default_annotations_from_meta() {
152150
*/
153151
public function test_get_overridden_annotations_from_meta() {
154152
$annotations = array(
155-
'instructions' => 'Enjoy responsibly.',
156153
'readonly' => true,
157154
'destructive' => false,
158155
'idempotent' => false,

tests/phpunit/tests/abilities-api/wpRegisterAbility.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public function test_register_valid_ability(): void {
165165
$expected_annotations = array_merge(
166166
self::$test_ability_args['meta']['annotations'],
167167
array(
168-
'instructions' => '',
169168
'idempotent' => false,
170169
)
171170
);

0 commit comments

Comments
 (0)