diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 8c79cc8722..b002b5cc95 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -490,7 +490,14 @@ JS; esc_url( $embed_url ), absint( $width ), absint( $height ), - esc_attr__( 'Embedded WordPress Post' ) + esc_attr( + sprintf( + /* translators: 1: post title, 2: site name */ + __( '“%1$s” — %2$s' ), + get_the_title( $post ), + get_bloginfo( 'name' ) + ) + ) ); /** diff --git a/tests/phpunit/tests/oembed/template.php b/tests/phpunit/tests/oembed/template.php index 21fd4851e8..fd9fddd2b7 100644 --- a/tests/phpunit/tests/oembed/template.php +++ b/tests/phpunit/tests/oembed/template.php @@ -242,8 +242,15 @@ class Tests_Embed_Template extends WP_UnitTestCase { function test_get_post_embed_html() { $post_id = self::factory()->post->create(); + $title = esc_attr( + sprintf( + __( '“%1$s” — %2$s' ), + get_the_title( $post_id ), + get_bloginfo( 'name' ) + ) + ); - $expected = ''; + $expected = ''; $this->assertStringEndsWith( $expected, get_post_embed_html( 200, 200, $post_id ) ); }