diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 33d7d8b832..c7dfd38761 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -336,10 +336,10 @@ function wp_oembed_add_discovery_links() { $output = ''; if ( is_singular() ) { - $output .= '' . "\n"; + $output .= '' . "\n"; if ( class_exists( 'SimpleXMLElement' ) ) { - $output .= '' . "\n"; + $output .= '' . "\n"; } } diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 8b791d4417..7aa2534520 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -1007,7 +1007,11 @@ function rest_output_link_wp_head() { $resource = rest_get_queried_resource_route(); if ( $resource ) { - printf( '', esc_url( rest_url( $resource ) ) ); + printf( + '', + _x( 'JSON', 'REST API resource link name' ), + esc_url( rest_url( $resource ) ) + ); } } @@ -1032,7 +1036,14 @@ function rest_output_link_header() { $resource = rest_get_queried_resource_route(); if ( $resource ) { - header( sprintf( 'Link: <%s>; rel="alternate"; type="application/json"', sanitize_url( rest_url( $resource ) ) ), false ); + header( + sprintf( + 'Link: <%1$s>; rel="alternate"; title="%2$s"; type="application/json"', + sanitize_url( rest_url( $resource ) ), + _x( 'JSON', 'REST API resource link name' ) + ), + false + ); } } diff --git a/tests/phpunit/tests/oembed/controller.php b/tests/phpunit/tests/oembed/controller.php index dfaf462841..9011b789bb 100644 --- a/tests/phpunit/tests/oembed/controller.php +++ b/tests/phpunit/tests/oembed/controller.php @@ -127,7 +127,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase { 'response' => array( 'code' => 200, ), - 'body' => '', + 'body' => '', ); } diff --git a/tests/phpunit/tests/oembed/discovery.php b/tests/phpunit/tests/oembed/discovery.php index 38ad167b3c..675d3264fc 100644 --- a/tests/phpunit/tests/oembed/discovery.php +++ b/tests/phpunit/tests/oembed/discovery.php @@ -32,8 +32,8 @@ class Tests_oEmbed_Discovery extends WP_UnitTestCase { $this->go_to( home_url() ); $this->assertQueryTrue( 'is_front_page', 'is_singular', 'is_page' ); - $expected = '' . "\n"; - $expected .= '' . "\n"; + $expected = '' . "\n"; + $expected .= '' . "\n"; $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); @@ -45,8 +45,8 @@ class Tests_oEmbed_Discovery extends WP_UnitTestCase { $this->go_to( get_permalink( $post_id ) ); $this->assertQueryTrue( 'is_single', 'is_singular' ); - $expected = '' . "\n"; - $expected .= '' . "\n"; + $expected = '' . "\n"; + $expected .= '' . "\n"; $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); } @@ -60,8 +60,8 @@ class Tests_oEmbed_Discovery extends WP_UnitTestCase { $this->go_to( get_permalink( $post_id ) ); $this->assertQueryTrue( 'is_page', 'is_singular' ); - $expected = '' . "\n"; - $expected .= '' . "\n"; + $expected = '' . "\n"; + $expected .= '' . "\n"; $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); } @@ -80,8 +80,8 @@ class Tests_oEmbed_Discovery extends WP_UnitTestCase { $this->go_to( get_permalink( $attachment_id ) ); $this->assertQueryTrue( 'is_attachment', 'is_singular', 'is_single' ); - $expected = '' . "\n"; - $expected .= '' . "\n"; + $expected = '' . "\n"; + $expected .= '' . "\n"; $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); }