Skip to content

Commit 1e317ce

Browse files
committed
Refactor how new line is added
1 parent 6b5fe21 commit 1e317ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

includes/create-theme/theme-locale.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ private static function escape_text_content( $string ) {
3535
$p->process_tokens();
3636
$text = $p->get_text();
3737
$tokens = $p->get_tokens();
38-
$translators_note = $p->get_translators_note() . "\n";
38+
$translators_note = $p->get_translators_note();
3939

4040
if ( ! empty( $tokens ) ) {
41-
return "<?php $translators_note echo sprintf( esc_html__( '$text', '" . wp_get_theme()->get( 'TextDomain' ) . "' ), " . implode(
41+
$php_tag = '<?php ';
42+
$php_tag .= $translators_note . "\n";
43+
$php_tag .= "echo sprintf( esc_html__( '$text', '" . wp_get_theme()->get( 'TextDomain' ) . "' ), " . implode(
4244
', ',
4345
array_map(
4446
function( $token ) {
@@ -47,6 +49,7 @@ function( $token ) {
4749
$tokens
4850
)
4951
) . ' ); ?>';
52+
return $php_tag;
5053
}
5154

5255
return "<?php esc_html_e('" . $string . "', '" . wp_get_theme()->get( 'TextDomain' ) . "');?>";

0 commit comments

Comments
 (0)