Do I need to use esc_html with get_bloginfo?
-
Should I be using esc_html with get_bloginfo? For example if I’m filtering wp_title in my functions.php akin to something like this:
# CUSTOM PAGE TITLE add_filter('wp_title', 'my_home_title'); function my_home_title($title) { if (is_front_page()) { return esc_html((get_bloginfo( 'description' ) . ' | ' . get_bloginfo( 'name' ))); } else { return esc_html((get_the_title() . ' | ' . get_bloginfo( 'name' ))); } return $title; } # END CUSTOM PAGE TITLE
Similarly would I need to use esc_url for urls that are entirely comprised of wordpress functions? Such as when using the permalink like:
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Do I need to use esc_html with get_bloginfo?’ is closed to new replies.