I have just added few social media icons to share the current post. So the code is below for pinterest (example purpose). But the reviewer said echo should be escaped.
Why the reviewer pointed it to escape the "echo" and what is the way to do so...
<!-- pinterest -->
<a href="/?media=<?php echo get_the_post_thumbnail_url(); ?>&url=<?php echo get_permalink(); ?>&is_video=false&description=<?php echo get_the_title(); ?>" target="blank"><i class="fab fa-pinterest-square"></i></a>
I have just added few social media icons to share the current post. So the code is below for pinterest (example purpose). But the reviewer said echo should be escaped.
Why the reviewer pointed it to escape the "echo" and what is the way to do so...
<!-- pinterest -->
<a href="https://pinterest/pin/create/bookmarklet/?media=<?php echo get_the_post_thumbnail_url(); ?>&url=<?php echo get_permalink(); ?>&is_video=false&description=<?php echo get_the_title(); ?>" target="blank"><i class="fab fa-pinterest-square"></i></a>
Share
Improve this question
asked Jan 6, 2020 at 5:10
webfuelcodewebfuelcode
212 bronze badges
1 Answer
Reset to default -1Do not use echo because WordPress has already defined it. So use it as given below:
<?php the_post_thumbnail(); ?>
<?php the_permalink(); ?>
<?php the_title(); ?>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744850092a4597074.html
评论列表(0条)