esc_html__ & esc_html_e

This commit is contained in:
Alexander Agnarson 2016-03-22 19:16:21 +01:00
parent add13f3e88
commit e1809c5280
13 changed files with 42 additions and 42 deletions

View file

@ -10,7 +10,7 @@
</div>
<div class="entry-content">
<p><?php _e( 'The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'blogrow' ); ?></p>
<p><?php esc_html_e( 'The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'blogrow' ); ?></p>
</div>
</div><!--/.pad-->

View file

@ -4,11 +4,11 @@
<?php if ( have_comments() ) : global $wp_query; ?>
<h3 class="heading"><?php comments_number( __( 'No Responses', 'blogrow' ), __( '1 Response', 'blogrow' ), __( '% Responses', 'blogrow' ) ); ?></h3>
<h3 class="heading"><?php comments_number( esc_html__( 'No Responses', 'blogrow' ), esc_html__( '1 Response', 'blogrow' ), esc_html__( '% Responses', 'blogrow' ) ); ?></h3>
<ul class="comment-tabs group">
<li class="active"><a href="#commentlist-container"><i class="fa fa-comments-o"></i><?php _e( 'Comments', 'blogrow' ); ?><span><?php echo count($wp_query->comments_by_type['comment']); ?></span></a></li>
<li><a href="#pinglist-container"><i class="fa fa-share"></i><?php _e( 'Pingbacks', 'blogrow' ); ?><span><?php echo count($wp_query->comments_by_type['pings']); ?></span></a></li>
<li class="active"><a href="#commentlist-container"><i class="fa fa-comments-o"></i><?php esc_html_e( 'Comments', 'blogrow' ); ?><span><?php echo count($wp_query->comments_by_type['comment']); ?></span></a></li>
<li><a href="#pinglist-container"><i class="fa fa-share"></i><?php esc_html_e( 'Pingbacks', 'blogrow' ); ?><span><?php echo count($wp_query->comments_by_type['pings']); ?></span></a></li>
</ul>
<?php if ( ! empty( $comments_by_type['comment'] ) ) { ?>

View file

@ -16,13 +16,13 @@
<div class="entry-content">
<?php
if ( is_search() ) { the_excerpt(); }
else the_content(__('Continue reading...','blogrow'));
else the_content(esc_html__('Continue reading...','blogrow'));
?>
</div><!--/.entry-->
<footer class="entry-footer group">
<div class="entry-author-avatar"><?php echo get_avatar(get_the_author_meta('user_email'),'64'); ?></div>
<div class="entry-author"><?php _e('by','blogrow'); ?> <?php the_author_posts_link(); ?></div>
<div class="entry-author"><?php esc_html_e('by','blogrow'); ?> <?php the_author_posts_link(); ?></div>
<div class="entry-date updated"><i class="fa fa-clock-o"></i><?php the_time('j M, Y'); ?></div>
</footer>

View file

@ -61,13 +61,13 @@
<?php if ( ot_get_option( 'copyright' ) ): ?>
<p><?php echo esc_attr( ot_get_option( 'copyright' ) ); ?></p>
<?php else: ?>
<p><?php bloginfo(); ?> &copy; <?php echo date( 'Y' ); ?>. <?php _e('All Rights Reserved.','blogrow'); ?></p>
<p><?php bloginfo(); ?> &copy; <?php echo date( 'Y' ); ?>. <?php esc_html_e('All Rights Reserved.','blogrow'); ?></p>
<?php endif; ?>
</div><!--/#copyright-->
<?php if ( ot_get_option( 'credit' ) != 'off' ): ?>
<div id="credit">
<p><?php _e('Powered by','blogrow'); ?> <a href="http://wordpress.org" rel="nofollow">WordPress</a>. <?php _e('Theme by','blogrow'); ?> <a href="http://alxmedia.se" rel="nofollow">Alx</a>.</p>
<p><?php esc_html_e('Powered by','blogrow'); ?> <a href="http://wordpress.org" rel="nofollow">WordPress</a>. <?php esc_html_e('Theme by','blogrow'); ?> <a href="http://alxmedia.se" rel="nofollow">Alx</a>.</p>
</div><!--/#credit-->
<?php endif; ?>

View file

@ -24,10 +24,10 @@ class AlxTabs extends WP_Widget {
private function _create_tabs($tabs,$count) {
// Borrowed from Jermaine Maree, thanks mate!
$titles = array(
'recent' => __('Recent Posts','blogrow'),
'popular' => __('Popular Posts','blogrow'),
'comments' => __('Recent Comments','blogrow'),
'tags' => __('Tags','blogrow')
'recent' => esc_html__('Recent Posts','blogrow'),
'popular' => esc_html__('Popular Posts','blogrow'),
'comments' => esc_html__('Recent Comments','blogrow'),
'tags' => esc_html__('Tags','blogrow')
);
$icons = array(
'recent' => 'fa fa-clock-o',
@ -184,7 +184,7 @@ class AlxTabs extends WP_Widget {
<div class="tab-item-inner group">
<?php $str=explode(' ',get_comment_excerpt($comment->comment_ID)); $comment_excerpt=implode(' ',array_slice($str,0,11)); if(count($str) > 11 && substr($comment_excerpt,-1)!='.') $comment_excerpt.='...' ?>
<div class="tab-item-name"><?php echo esc_attr( $comment->comment_author ); ?> <?php _e('says:','blogrow'); ?></div>
<div class="tab-item-name"><?php echo esc_attr( $comment->comment_author ); ?> <?php esc_html_e('says:','blogrow'); ?></div>
<div class="tab-item-comment"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php echo esc_attr( $comment_excerpt ); ?></a></div>
</div>

View file

@ -14,53 +14,53 @@
<?php if ( !have_posts() ): ?><i class="fa fa-exclamation-circle"></i><?php endif; ?>
<?php $search_results=$wp_query->found_posts;
if ($search_results==1) {
echo $search_results.' '.__('Search result','blogrow');
echo $search_results.' '.esc_html__('Search result','blogrow');
} else {
echo $search_results.' '.__('Search results','blogrow');
echo $search_results.' '.esc_html__('Search results','blogrow');
}
?>
</h1>
<?php elseif ( is_404() ): ?>
<h1><i class="fa fa-exclamation-circle"></i><?php _e('Error 404.','blogrow'); ?> <span><?php _e('Page not found!','blogrow'); ?></span></h1>
<h1><i class="fa fa-exclamation-circle"></i><?php esc_html_e('Error 404.','blogrow'); ?> <span><?php esc_html_e('Page not found!','blogrow'); ?></span></h1>
<?php elseif ( is_author() ): ?>
<?php $author = get_userdata( get_query_var('author') );?>
<h1><i class="fa fa-user"></i><?php _e('Author:','blogrow'); ?> <span><?php echo $author->display_name;?></span></h1>
<h1><i class="fa fa-user"></i><?php esc_html_e('Author:','blogrow'); ?> <span><?php echo $author->display_name;?></span></h1>
<?php elseif ( is_category() ): ?>
<h1><i class="fa fa-folder-open"></i><?php _e('Category:','blogrow'); ?> <span><?php echo single_cat_title('', false); ?></span></h1>
<h1><i class="fa fa-folder-open"></i><?php esc_html_e('Category:','blogrow'); ?> <span><?php echo single_cat_title('', false); ?></span></h1>
<?php elseif ( is_tag() ): ?>
<h1><i class="fa fa-tags"></i><?php _e('Tagged:','blogrow'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>
<h1><i class="fa fa-tags"></i><?php esc_html_e('Tagged:','blogrow'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>
<?php elseif ( is_day() ): ?>
<h1><i class="fa fa-calendar"></i><?php _e('Daily Archive:','blogrow'); ?> <span><?php echo get_the_time('F j, Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Daily Archive:','blogrow'); ?> <span><?php echo get_the_time('F j, Y'); ?></span></h1>
<?php elseif ( is_month() ): ?>
<h1><i class="fa fa-calendar"></i><?php _e('Monthly Archive:','blogrow'); ?> <span><?php echo get_the_time('F Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Monthly Archive:','blogrow'); ?> <span><?php echo get_the_time('F Y'); ?></span></h1>
<?php elseif ( is_year() ): ?>
<h1><i class="fa fa-calendar"></i><?php _e('Yearly Archive:','blogrow'); ?> <span><?php echo get_the_time('Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Yearly Archive:','blogrow'); ?> <span><?php echo get_the_time('Y'); ?></span></h1>
<?php elseif ( has_post_format('audio') ): ?>
<h1><i class="fa fa-volume-up"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Audio','blogrow'); ?></span></h1>
<h1><i class="fa fa-volume-up"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Audio','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('aside') ): ?>
<h1><i class="fa fa-pen"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Aside','blogrow'); ?></span></h1>
<h1><i class="fa fa-pen"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Aside','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('chat') ): ?>
<h1><i class="fa fa-comments-o"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Chat','blogrow'); ?></span></h1>
<h1><i class="fa fa-comments-o"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Chat','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('gallery') ): ?>
<h1><i class="fa fa-picture-o"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Gallery','blogrow'); ?></span></h1>
<h1><i class="fa fa-picture-o"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Gallery','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('image') ): ?>
<h1><i class="fa fa-camera"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Image','blogrow'); ?></span></h1>
<h1><i class="fa fa-camera"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Image','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('link') ): ?>
<h1><i class="fa fa-link"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Link','blogrow'); ?></span></h1>
<h1><i class="fa fa-link"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Link','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('quote') ): ?>
<h1><i class="fa fa-quote-left"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Quote','blogrow'); ?></span></h1>
<h1><i class="fa fa-quote-left"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Quote','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('status') ): ?>
<h1><i class="fa fa-bullhorn"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Status','blogrow'); ?></span></h1>
<h1><i class="fa fa-bullhorn"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Status','blogrow'); ?></span></h1>
<?php elseif ( has_post_format('video') ): ?>
<h1><i class="fa fa-video-camera"></i><?php _e('Type:','blogrow'); ?> <span><?php _e('Video','blogrow'); ?></span></h1>
<h1><i class="fa fa-video-camera"></i><?php esc_html_e('Type:','blogrow'); ?> <span><?php esc_html_e('Video','blogrow'); ?></span></h1>
<?php else: ?>
<h2><?php the_title(); ?></h2>

View file

@ -1,6 +1,6 @@
<?php if ( is_single() ): ?>
<ul class="post-nav group">
<li class="next"><?php next_post_link('%link', '<i class="fa fa-chevron-right"></i><strong>'.__('Next post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
<li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.__('Previous post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
<li class="next"><?php next_post_link('%link', '<i class="fa fa-chevron-right"></i><strong>'.esc_html__('Next post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
<li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.esc_html__('Previous post', 'blogrow').'</strong> <span>%title</span>'); ?></li>
</ul>
<?php endif; ?>

View file

@ -3,7 +3,7 @@
<?php if ( $related->have_posts() ): ?>
<div class="pad">
<h4 class="heading"><?php _e('You may also like','blogrow'); ?></h4>
<h4 class="heading"><?php esc_html_e('You may also like','blogrow'); ?></h4>
<ul class="related-posts group">
<?php while ( $related->have_posts() ) : $related->the_post(); ?>

View file

@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Blogrow\n"
"POT-Creation-Date: 2016-03-01 13:37+0100\n"
"PO-Revision-Date: 2016-03-01 13:37+0100\n"
"POT-Creation-Date: 2016-03-22 19:15+0100\n"
"PO-Revision-Date: 2016-03-22 19:15+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: English\n"
@ -10,7 +10,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.7\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-KeywordsList: esc_html__;esc_html_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"

Binary file not shown.

View file

@ -6,9 +6,9 @@
<?php get_template_part('inc/page-title'); ?>
<div class="notebox">
<?php _e('For the term','blogrow'); ?> "<span><?php echo get_search_query(); ?></span>".
<?php esc_html_e('For the term','blogrow'); ?> "<span><?php echo get_search_query(); ?></span>".
<?php if ( !have_posts() ): ?>
<?php _e('Please try another search:','blogrow'); ?>
<?php esc_html_e('Please try another search:','blogrow'); ?>
<?php endif; ?>
<div class="search-again">
<?php get_search_form(); ?>

View file

@ -1,5 +1,5 @@
<form method="get" class="searchform themeform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div>
<input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php _e('To search type and hit enter','blogrow'); ?>';" onfocus="if(this.value=='<?php _e('To search type and hit enter','blogrow'); ?>')this.value='';" value="<?php _e('To search type and hit enter','blogrow'); ?>" />
<input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php esc_html_e('To search type and hit enter','blogrow'); ?>';" onfocus="if(this.value=='<?php esc_html_e('To search type and hit enter','blogrow'); ?>')this.value='';" value="<?php esc_html_e('To search type and hit enter','blogrow'); ?>" />
</div>
</form>

View file

@ -19,9 +19,9 @@
<div class="entry-content themeform">
<?php the_content(); ?>
<?php wp_link_pages(array('before'=>'<div class="entry-pages">'.__('Pages:','blogrow'),'after'=>'</div>')); ?>
<?php wp_link_pages(array('before'=>'<div class="entry-pages">'.esc_html__('Pages:','blogrow'),'after'=>'</div>')); ?>
<div class="clear"></div>
<?php the_tags('<p class="entry-tags"><span>'.__('Tags:','blogrow').'</span> ','','</p>'); ?>
<?php the_tags('<p class="entry-tags"><span>'.esc_html__('Tags:','blogrow').'</span> ','','</p>'); ?>
</div><!--/.entry-->
<div class="entry-date updated"><i class="fa fa-clock-o"></i><?php the_time('j M, Y'); ?></div>