Skip to content

Commit

Permalink
esc_html__ & esc_html_e
Browse files Browse the repository at this point in the history
  • Loading branch information
AlxMedia committed Mar 22, 2016
1 parent db396d6 commit 264a70f
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>

<div class="entry">
<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.', 'kontrast' ); ?></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.', 'kontrast' ); ?></p>
</div>

</div><!--/.pad-->
Expand Down
6 changes: 3 additions & 3 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

<?php if ( have_comments() ) : global $wp_query; ?>

<h3 class="heading"><?php comments_number( __( 'No Responses', 'kontrast' ), __( '1 Response', 'kontrast' ), __( '% Responses', 'kontrast' ) ); ?></h3>
<h3 class="heading"><?php comments_number( esc_html__( 'No Responses', 'kontrast' ), esc_html__( '1 Response', 'kontrast' ), esc_html__( '% Responses', 'kontrast' ) ); ?></h3>

<ul class="comment-tabs group">
<li class="active"><a href="#commentlist-container"><i class="fa fa-comments-o"></i><?php _e( 'Comments', 'kontrast' ); ?><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', 'kontrast' ); ?><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', 'kontrast' ); ?><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', 'kontrast' ); ?><span><?php echo count($wp_query->comments_by_type['pings']); ?></span></a></li>
</ul>

<?php if ( ! empty( $comments_by_type['comment'] ) ) { ?>
Expand Down
4 changes: 2 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,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.', 'kontrast' ); ?></p>
<p><?php bloginfo(); ?> &copy; <?php echo date( 'Y' ); ?>. <?php esc_html_e( 'All Rights Reserved.', 'kontrast' ); ?></p>
<?php endif; ?>
</div><!--/#copyright-->

<?php if ( ot_get_option( 'credit' ) != 'off' ): ?>
<div id="credit">
<p><?php _e('Powered by','kontrast'); ?> <a href="http://wordpress.org" rel="nofollow">WordPress</a>. <?php _e('Theme by','kontrast'); ?> <a href="http://alxmedia.se" rel="nofollow">Alx</a>.</p>
<p><?php esc_html_e('Powered by','kontrast'); ?> <a href="http://wordpress.org" rel="nofollow">WordPress</a>. <?php esc_html_e('Theme by','kontrast'); ?> <a href="http://alxmedia.se" rel="nofollow">Alx</a>.</p>
</div><!--/#credit-->
<?php endif; ?>

Expand Down
10 changes: 5 additions & 5 deletions functions/widgets/alx-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ function AlxTabs() {
private function _create_tabs($tabs,$count) {
// Borrowed from Jermaine Maree, thanks mate!
$titles = array(
'recent' => __('Recent Posts','kontrast'),
'popular' => __('Popular Posts','kontrast'),
'comments' => __('Recent Comments','kontrast'),
'tags' => __('Tags','kontrast')
'recent' => esc_html__('Recent Posts','kontrast'),
'popular' => esc_html__('Popular Posts','kontrast'),
'comments' => esc_html__('Recent Comments','kontrast'),
'tags' => esc_html__('Tags','kontrast')
);
$icons = array(
'recent' => 'fa fa-clock-o',
Expand Down Expand Up @@ -184,7 +184,7 @@ public function widget($args, $instance) {

<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:','kontrast'); ?></div>
<div class="tab-item-name"><?php echo esc_attr( $comment->comment_author ); ?> <?php esc_html_e('says:','kontrast'); ?></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>
Expand Down
18 changes: 9 additions & 9 deletions inc/page-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@
<?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','kontrast');
echo $search_results.' '.esc_html__('Search result','kontrast');
} else {
echo $search_results.' '.__('Search results','kontrast');
echo $search_results.' '.esc_html__('Search results','kontrast');
}
?>
</h1>

<?php elseif ( is_404() ): ?>
<h1><i class="fa fa-exclamation-circle"></i><?php _e('Error 404.','kontrast'); ?> <span><?php _e('Page not found!','kontrast'); ?></span></h1>
<h1><i class="fa fa-exclamation-circle"></i><?php esc_html_e('Error 404.','kontrast'); ?> <span><?php esc_html_e('Page not found!','kontrast'); ?></span></h1>

<?php elseif ( is_author() ): ?>
<?php $author = get_userdata( get_query_var('author') );?>
<h1><i class="fa fa-user"></i><?php _e('Author:','kontrast'); ?> <span><?php echo $author->display_name;?></span></h1>
<h1><i class="fa fa-user"></i><?php esc_html_e('Author:','kontrast'); ?> <span><?php echo $author->display_name;?></span></h1>

<?php elseif ( is_category() ): ?>
<h1><i class="fa fa-folder-open"></i><?php _e('Category:','kontrast'); ?> <span><?php echo single_cat_title('', false); ?></span></h1>
<h1><i class="fa fa-folder-open"></i><?php esc_html_e('Category:','kontrast'); ?> <span><?php echo single_cat_title('', false); ?></span></h1>

<?php elseif ( is_tag() ): ?>
<h1><i class="fa fa-tags"></i><?php _e('Tagged:','kontrast'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>
<h1><i class="fa fa-tags"></i><?php esc_html_e('Tagged:','kontrast'); ?> <span><?php echo single_tag_title('', false); ?></span></h1>

<?php elseif ( is_day() ): ?>
<h1><i class="fa fa-calendar"></i><?php _e('Daily Archive:','kontrast'); ?> <span><?php echo get_the_time('F j, Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Daily Archive:','kontrast'); ?> <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:','kontrast'); ?> <span><?php echo get_the_time('F Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Monthly Archive:','kontrast'); ?> <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:','kontrast'); ?> <span><?php echo get_the_time('Y'); ?></span></h1>
<h1><i class="fa fa-calendar"></i><?php esc_html_e('Yearly Archive:','kontrast'); ?> <span><?php echo get_the_time('Y'); ?></span></h1>

<?php else: ?>
<h2><?php the_title(); ?></h2>
Expand Down
4 changes: 2 additions & 2 deletions inc/post-nav.php
Original file line number Diff line number Diff line change
@@ -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 story', 'kontrast').'</strong> <span>%title</span>'); ?></li>
<li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.__('Previous story', 'kontrast').'</strong> <span>%title</span>'); ?></li>
<li class="next"><?php next_post_link('%link', '<i class="fa fa-chevron-right"></i><strong>'.esc_html__('Next story', 'kontrast').'</strong> <span>%title</span>'); ?></li>
<li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.esc_html__('Previous story', 'kontrast').'</strong> <span>%title</span>'); ?></li>
</ul>
<?php endif; ?>
2 changes: 1 addition & 1 deletion inc/related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php if ( $related->have_posts() ): ?>

<h4 class="heading">
<i class="fa fa-hand-o-right"></i><?php _e('You may also like...','kontrast'); ?>
<i class="fa fa-hand-o-right"></i><?php esc_html_e('You may also like...','kontrast'); ?>
</h4>

<ul class="related-posts group">
Expand Down
2 changes: 1 addition & 1 deletion inc/sharrre.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="sharrre-container">
<span><?php _e('Share','kontrast'); ?></span>
<span><?php esc_html_e('Share','kontrast'); ?></span>
<div id="twitter" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="Tweet"><a class="box" href="#"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fa fa-twitter"></i></div></a></div>
<div id="facebook" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="Like"></div>
<div id="googleplus" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="+1"></div>
Expand Down
Binary file removed languages/en_US.mo
Binary file not shown.
6 changes: 3 additions & 3 deletions languages/en_US.po → languages/kontrast.pot
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: Kontrast\n"
"POT-Creation-Date: 2015-02-07 11:48+0100\n"
"PO-Revision-Date: 2015-02-07 11:48+0100\n"
"POT-Creation-Date: 2016-03-22 19:10+0100\n"
"PO-Revision-Date: 2016-03-22 19:10+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: English\n"
"MIME-Version: 1.0\n"
"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"

Expand Down
4 changes: 2 additions & 2 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<div class="pad group">

<div class="notebox">
<?php _e('For the term','kontrast'); ?> "<span><?php echo get_search_query(); ?></span>".
<?php esc_html_e('For the term','kontrast'); ?> "<span><?php echo get_search_query(); ?></span>".
<?php if ( !have_posts() ): ?>
<?php _e('Please try another search:','kontrast'); ?>
<?php esc_html_e('Please try another search:','kontrast'); ?>
<?php endif; ?>
<div class="search-again">
<?php get_search_form(); ?>
Expand Down
2 changes: 1 addition & 1 deletion searchform.php
Original file line number Diff line number Diff line change
@@ -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','kontrast'); ?>';" onfocus="if(this.value=='<?php _e('To search type and hit enter','kontrast'); ?>')this.value='';" value="<?php _e('To search type and hit enter','kontrast'); ?>" />
<input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php esc_html_e('To search type and hit enter','kontrast'); ?>';" onfocus="if(this.value=='<?php esc_html_e('To search type and hit enter','kontrast'); ?>')this.value='';" value="<?php esc_html_e('To search type and hit enter','kontrast'); ?>" />
</div>
</form>
2 changes: 1 addition & 1 deletion sidebar-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="sidebar s2">

<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','kontrast'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
<a class="sidebar-toggle" title="<?php esc_html_e('Expand Sidebar','kontrast'); ?>"><i class="fa icon-sidebar-toggle"></i></a>

<div class="sidebar-content">

Expand Down
2 changes: 1 addition & 1 deletion sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div class="sidebar s1 dark">

<a class="sidebar-toggle" title="<?php _e('Expand Sidebar','kontrast'); ?>"><i class="fa icon-sidebar-toggle"></i></a>
<a class="sidebar-toggle" title="<?php esc_html_e('Expand Sidebar','kontrast'); ?>"><i class="fa icon-sidebar-toggle"></i></a>

<div class="sidebar-content">

Expand Down
6 changes: 3 additions & 3 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="post-inner group">

<h1 class="post-title"><?php the_title(); ?></h1>
<p class="post-byline"><?php _e('by','kontrast'); ?> <?php the_author_posts_link(); ?> &middot; <?php the_time(get_option('date_format')); ?></p>
<p class="post-byline"><?php esc_html_e('by','kontrast'); ?> <?php the_author_posts_link(); ?> &middot; <?php the_time(get_option('date_format')); ?></p>

<?php if( get_post_format() ) { get_template_part('inc/post-formats'); } ?>

Expand All @@ -20,7 +20,7 @@
<div class="entry <?php if ( ot_get_option('sharrre') != 'off' ) { echo 'share'; }; ?>">
<div class="entry-inner">
<?php the_content(); ?>
<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','kontrast'),'after'=>'</div>')); ?>
<?php wp_link_pages(array('before'=>'<div class="post-pages">'.esc_html__('Pages:','kontrast'),'after'=>'</div>')); ?>
</div>
<?php if ( ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>
<div class="clear"></div>
Expand All @@ -32,7 +32,7 @@

<div class="clear"></div>

<?php the_tags('<p class="post-tags"><span>'.__('Tags:','kontrast').'</span> ','','</p>'); ?>
<?php the_tags('<p class="post-tags"><span>'.esc_html__('Tags:','kontrast').'</span> ','','</p>'); ?>

<?php if ( ( ot_get_option( 'author-bio' ) != 'off' ) && get_the_author_meta( 'description' ) ): ?>
<div class="author-bio">
Expand Down

0 comments on commit 264a70f

Please sign in to comment.