forked from mirror/_s
Split strings into variables
This commit is contained in:
parent
5e62b8dc9e
commit
fc9910cf96
|
@ -82,17 +82,18 @@ function _s_posted_on() {
|
||||||
esc_html( get_the_modified_date() )
|
esc_html( get_the_modified_date() )
|
||||||
);
|
);
|
||||||
|
|
||||||
printf(
|
$posted_on = sprintf(
|
||||||
'<span class="posted-on">' . __( 'Posted on %1$s', '_s' ) . '</span><span class="byline"> ' . __( 'by %2$s', '_s' ) . '</span>',
|
_x( 'Posted on %s', 'post date', '_s' ),
|
||||||
sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>',
|
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
|
||||||
esc_url( get_permalink() ),
|
|
||||||
$time_string
|
|
||||||
),
|
|
||||||
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
|
|
||||||
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
|
||||||
esc_html( get_the_author() )
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$byline = sprintf(
|
||||||
|
_x( 'by %s', 'post author', '_s' ),
|
||||||
|
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
|
||||||
|
);
|
||||||
|
|
||||||
|
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
|
||||||
|
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
Reference in New Issue