diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
index 2736204..17b9ac4 100644
|
a
|
b
|
function wp_oembed_register_route() { |
| 345 | 345 | function wp_oembed_add_discovery_links() { |
| 346 | 346 | $output = ''; |
| 347 | 347 | |
| 348 | | if ( is_singular() ) { |
| | 348 | if ( is_singular() && ! is_front_page() ) { |
| 349 | 349 | $output .= '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; |
| 350 | 350 | |
| 351 | 351 | if ( class_exists( 'SimpleXMLElement' ) ) { |
diff --git a/tests/phpunit/tests/oembed/discovery.php b/tests/phpunit/tests/oembed/discovery.php
index 63eb5bb..6331602 100644
|
a
|
b
|
class Tests_oEmbed_Discovery extends WP_UnitTestCase { |
| 8 | 8 | $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) ); |
| 9 | 9 | } |
| 10 | 10 | |
| | 11 | function test_add_oembed_discovery_links_front_page() { |
| | 12 | $this->go_to( home_url('/') ); |
| | 13 | $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) ); |
| | 14 | } |
| | 15 | |
| | 16 | function test_add_oembed_discovery_links_static_front_page() { |
| | 17 | update_option( 'show_on_front', 'page' ); |
| | 18 | update_option( 'page_for_posts', self::factory()->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ) ); |
| | 19 | update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); |
| | 20 | |
| | 21 | $this->go_to( home_url('/') ); |
| | 22 | $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) ); |
| | 23 | |
| | 24 | update_option( 'show_on_front', 'posts' ); |
| | 25 | } |
| | 26 | |
| 11 | 27 | function test_add_oembed_discovery_links_to_post() { |
| 12 | 28 | $post_id = self::factory()->post->create(); |
| 13 | 29 | $this->go_to( get_permalink( $post_id ) ); |