From b3287e9b5837adf51a5d33b77bf1c5ce0992ed9b Mon Sep 17 00:00:00 2001 From: Yoav Farh Date: Tue, 3 Jan 2017 18:14:17 +0200 Subject: [PATCH 1/3] Make sure the translation of the post editing link doesn't break because of screen reader text --- inc/template-tags.php | 4 ++-- template-parts/content-page.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 7aa07144..a9542b24 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -69,8 +69,8 @@ function _s_entry_footer() { edit_post_link( sprintf( /* translators: %s: Name of current post */ - esc_html__( 'Edit %s', '_s' ), - the_title( '"', '"', false ) + __( 'Edit %s', '_s' ), + get_the_title() ), '', '' diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 6b5d7f73..a2250abe 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -31,8 +31,8 @@ edit_post_link( sprintf( /* translators: %s: Name of current post */ - esc_html__( 'Edit %s', '_s' ), - the_title( '"', '"', false ) + __( 'Edit %s', '_s' ), + get_the_title() ), '', '' From 1f1def7496a58e1056eb2c09acca90550e674505 Mon Sep 17 00:00:00 2001 From: Yoav Farh Date: Tue, 3 Jan 2017 18:23:33 +0200 Subject: [PATCH 2/3] update comment --- inc/template-tags.php | 2 +- template-parts/content-page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index a9542b24..6032661d 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -68,7 +68,7 @@ function _s_entry_footer() { edit_post_link( sprintf( - /* translators: %s: Name of current post */ + /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', '_s' ), get_the_title() ), diff --git a/template-parts/content-page.php b/template-parts/content-page.php index a2250abe..80819175 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -30,7 +30,7 @@ %s', '_s' ), get_the_title() ), From 5a2f2893dab514507fd1269969cafe2916882862 Mon Sep 17 00:00:00 2001 From: Yoav Farh Date: Tue, 3 Jan 2017 20:27:16 +0200 Subject: [PATCH 3/3] santize translation --- inc/template-tags.php | 2 +- template-parts/content-page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 6032661d..c7ecf029 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -69,7 +69,7 @@ function _s_entry_footer() { edit_post_link( sprintf( /* translators: %s: Name of current post. Only visible to screen readers */ - __( 'Edit %s', '_s' ), + wp_kses( __( 'Edit %s', '_s' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ), '', diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 80819175..42614812 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -31,7 +31,7 @@ edit_post_link( sprintf( /* translators: %s: Name of current post. Only visible to screen readers */ - __( 'Edit %s', '_s' ), + wp_kses( __( 'Edit %s', '_s' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ), '',