Changeset 58286
- Timestamp:
- 06/02/2024 10:00:26 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/embed.php
r58143 r58286 337 337 338 338 if ( is_singular() ) { 339 $output .= '<link rel="alternate" t ype="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";339 $output .= '<link rel="alternate" title="' . _x( 'oEmbed (JSON)', 'oEmbed resource link name' ) . '" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 340 340 341 341 if ( class_exists( 'SimpleXMLElement' ) ) { 342 $output .= '<link rel="alternate" t ype="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";342 $output .= '<link rel="alternate" title="' . _x( 'oEmbed (XML)', 'oEmbed resource link name' ) . '" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 343 343 } 344 344 } -
trunk/src/wp-includes/rest-api.php
r58267 r58286 1008 1008 1009 1009 if ( $resource ) { 1010 printf( '<link rel="alternate" type="application/json" href="%s" />', esc_url( rest_url( $resource ) ) ); 1010 printf( 1011 '<link rel="alternate" title="%1$s" type="application/json" href="%2$s" />', 1012 _x( 'JSON', 'REST API resource link name' ), 1013 esc_url( rest_url( $resource ) ) 1014 ); 1011 1015 } 1012 1016 } … … 1033 1037 1034 1038 if ( $resource ) { 1035 header( sprintf( 'Link: <%s>; rel="alternate"; type="application/json"', sanitize_url( rest_url( $resource ) ) ), false ); 1039 header( 1040 sprintf( 1041 'Link: <%1$s>; rel="alternate"; title="%2$s"; type="application/json"', 1042 sanitize_url( rest_url( $resource ) ), 1043 _x( 'JSON', 'REST API resource link name' ) 1044 ), 1045 false 1046 ); 1036 1047 } 1037 1048 } -
trunk/tests/phpunit/tests/oembed/controller.php
r58235 r58286 128 128 'code' => 200, 129 129 ), 130 'body' => '<html><head><link rel="alternate" t ype="application/json+oembed" href="' . self::UNTRUSTED_PROVIDER_URL . '" /></head><body></body></html>',130 'body' => '<html><head><link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="' . self::UNTRUSTED_PROVIDER_URL . '" /></head><body></body></html>', 131 131 ); 132 132 } -
trunk/tests/phpunit/tests/oembed/discovery.php
r52010 r58286 33 33 $this->assertQueryTrue( 'is_front_page', 'is_singular', 'is_page' ); 34 34 35 $expected = '<link rel="alternate" t ype="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";36 $expected .= '<link rel="alternate" t ype="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";35 $expected = '<link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 36 $expected .= '<link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 37 37 38 38 $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); … … 46 46 $this->assertQueryTrue( 'is_single', 'is_singular' ); 47 47 48 $expected = '<link rel="alternate" t ype="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";49 $expected .= '<link rel="alternate" t ype="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";48 $expected = '<link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 49 $expected .= '<link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 50 50 51 51 $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); … … 61 61 $this->assertQueryTrue( 'is_page', 'is_singular' ); 62 62 63 $expected = '<link rel="alternate" t ype="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";64 $expected .= '<link rel="alternate" t ype="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";63 $expected = '<link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 64 $expected .= '<link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 65 65 66 66 $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); … … 81 81 $this->assertQueryTrue( 'is_attachment', 'is_singular', 'is_single' ); 82 82 83 $expected = '<link rel="alternate" t ype="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";84 $expected .= '<link rel="alternate" t ype="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";83 $expected = '<link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 84 $expected .= '<link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 85 85 86 86 $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
Note: See TracChangeset
for help on using the changeset viewer.