How should I escape echo for this function...
function pen_post_sidebar_twitter() {
$twitter = esc_attr( get_option( 'twitter_handler' ));
echo ( '<input type="text" name="twitter_handler" value="'.$twitter.'" placeholder="Twitter handler" /> <p class="description">Enter twitter handler without the @ sign.</p>' );
}
How should I escape echo for this function...
function pen_post_sidebar_twitter() {
$twitter = esc_attr( get_option( 'twitter_handler' ));
echo ( '<input type="text" name="twitter_handler" value="'.$twitter.'" placeholder="Twitter handler" /> <p class="description">Enter twitter handler without the @ sign.</p>' );
}
Share
Improve this question
asked Jan 8, 2020 at 13:22
webfuelcodewebfuelcode
212 bronze badges
1 Answer
Reset to default 0Try this
function pen_post_sidebar_twitter() {
printf( '<input type="text" name="twitter_handler" value="%s" placeholder="Twitter handler" /> <p class="description">Enter twitter handler without the @ sign.</p>', esc_attr( get_option( 'twitter_handler' ) ) );
}
Thanks
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744849802a4597060.html
评论列表(0条)