diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php index 3fb36bff1e..28b51d7612 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php @@ -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, diff --git a/tests/phpunit/tests/rest-api/rest-plugins-controller.php b/tests/phpunit/tests/rest-api/rest-plugins-controller.php index 77203a73d3..30bec793b4 100644 --- a/tests/phpunit/tests/rest-api/rest-plugins-controller.php +++ b/tests/phpunit/tests/rest-api/rest-plugins-controller.php @@ -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'] ); } /**