Last active
August 29, 2015 13:57
-
-
Save grappler/9719579 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Original hardcoded text | |
echo 'Click <a href="'. esc_url( get_permalink() ) . '">here</a> to go and watch the video.'; | |
// Option 1 | |
printf( | |
__( 'Click <a href="%s">Here</a> to go and watch the video.', 'text-domain' ), | |
esc_url( get_permalink() ) | |
); | |
// Option 2 | |
printf( | |
__( 'Click %shere%s to go and watch the video.', 'text-domain'), | |
'<a href="'. esc_url( get_permalink() ) . '">', | |
'</a>' | |
); | |
// Option 3 | |
printf( | |
__( 'Click %s to go and watch the video.', 'text-domain' ), | |
'<a href="'. esc_url( get_permalink() ) . '">' . __( 'here', 'text-domain' ) . '</a>' | |
); | |
// Alternative option | |
echo '<a href="' . esc_url( get_permalink() ) . '">' . __( 'Watch the video', 'text-domain' ) . '</a>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment