REST API: Use a consistent name for the `textdomain` schema property between plugins, themes, and block directory controllers.

Follow-up to [48242].

See #50321, #50776.

git-svn-id: https://develop.svn.wordpress.org/trunk@48627 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-26 21:47:56 +00:00
parent dbb88efe5c
commit 40dd42c35d
2 changed files with 4 additions and 4 deletions

View File

@ -548,7 +548,7 @@ class WP_REST_Plugins_Controller extends WP_REST_Controller {
'network_only' => $item['Network'],
'requires_wp' => $item['RequiresWP'],
'requires_php' => $item['RequiresPHP'],
'text_domain' => $item['TextDomain'],
'textdomain' => $item['TextDomain'],
);
$data = $this->add_additional_fields_to_object( $data, $request );
@ -908,7 +908,7 @@ class WP_REST_Plugins_Controller extends WP_REST_Controller {
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'text_domain' => array(
'textdomain' => array(
'description' => __( 'The plugin\'s text domain.' ),
'type' => 'string',
'readonly' => true,

View File

@ -977,7 +977,7 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase {
$this->assertArrayHasKey( 'network_only', $properties );
$this->assertArrayHasKey( 'requires_wp', $properties );
$this->assertArrayHasKey( 'requires_php', $properties );
$this->assertArrayHasKey( 'text_domain', $properties );
$this->assertArrayHasKey( 'textdomain', $properties );
}
/**
@ -1001,7 +1001,7 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase {
$this->assertEquals( $network_only, $data['network_only'] );
$this->assertEquals( '5.6.0', $data['requires_php'] );
$this->assertEquals( '5.4.0', $data['requires_wp'] );
$this->assertEquals( 'test-plugin', $data['text_domain'] );
$this->assertEquals( 'test-plugin', $data['textdomain'] );
}
/**