Skip to content
Permalink
Browse files

adding escape functions part 5 (author and archiv)

  • Loading branch information...
kniebremser committed Jul 9, 2019
1 parent e2dde5b commit ecb51f8101e286dcb57106830a1a6f9b0c527f47
Showing with 104 additions and 100 deletions.
  1. +78 −75 archive.php
  2. +26 −25 author.php
@@ -47,7 +47,7 @@
if ( isset( $wp_query->query_vars['chapters'] ) ) {
$taxonomy_name = get_term_by( 'slug', $wp_query->query_vars['chapters'], 'chapters' );
if ( ! is_wp_error( $taxonomy_name ) && ! empty( $taxonomy_name ) ) $title_string = $taxonomy_name->name;
} elseif (isset($wp_query->query_vars['locations'])) {
} elseif ( isset( $wp_query->query_vars['locations'] ) ) {
$taxonomy_name = get_term_by( 'slug', $wp_query->query_vars['locations'], 'locations' );
if ( ! is_wp_error( $taxonomy_name ) && ! empty( $taxonomy_name ) ) $title_string = $taxonomy_name->name;
} elseif ( term_exists( $wp_query->query_vars['term'] ) ) {
@@ -64,123 +64,125 @@
if ( have_posts() ) {
?>

<h2 class="page-title">
<?php echo esc_html( $title_string ); ?>
</h2>
<h2 class="page-title">
<?php echo esc_html( $title_string ); ?>
</h2>

<?php
if ( isset( $wp_query->query_vars['chapters'] ) || ( $wp_query->query_vars['post_type'] == 'comic' ) ) {
?>

<div class="archiveresults">
<div class="archiveresults">

<?php
printf(
/* translators: Number of found comic */
esc_html( _n( '%d comic', '%d comics', $count, 'comicpress' ) ),
esc_html( $count )
);
?>
<?php
printf(
/* translators: Number of found comic */
esc_html( _n( '%d comic', '%d comics', $count, 'comicpress' ) ),
esc_html( $count )
);
?>

</div>
</div>

<?php
} else {
?>

<div class="archiveresults">
<div class="archiveresults">

<?php
printf(
/* translators: Number of found results */
esc_html( _n( '%d result', '%d results', $count, 'comicpress' ) ),
esc_html( $count )
);
?>
<?php
printf(
/* translators: Number of found results */
esc_html( _n( '%d result', '%d results', $count, 'comicpress' ) ),
esc_html( $count )
);
?>

</div>
</div>

<?php
}
?>

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

<?php
if ( function_exists( 'ceo_pluginfo' ) && ( isset( $wp_query->query_vars['chapters'] ) || isset( $wp_query->query_vars['characters'] ) || isset( $wp_query->query_vars['locations'] ) || ( $wp_query->query_vars['post_type'] == 'comic' ) ) && ( comicpress_themeinfo( 'display_archive_as_links' ) && ! comicpress_is_bbpress() ) ) {
while ( have_posts() ) :
the_post();
?>

<div class="archivecomicthumbwrap">
<div class="archivecomicthumbwrap">

<div class="archivecomicthumbdate">
<div class="archivecomicthumbdate">

<?php echo get_the_time( 'M jS, Y' ); ?>
<?php echo get_the_time( 'M jS, Y' ); ?>

</div>
</div>

<div class="archivecomicframe">
<div class="archivecomicframe">

<?php
$thumbnail = ceo_display_comic_thumbnail( 'thumbnail', $post );
$thumbnail = ( ! $thumbnail ) ? __( 'No Thumbnail or Featured Image Found.', 'comicpress' ) : $thumbnail;
?>

<a href="<?php the_permalink(); ?>" title="<?php echo the_title(); ?>">
<?php echo $thumbnail; ?>
</a>
<br />
<a href="<?php the_permalink(); ?>" title="<?php echo the_title(); ?>">
<?php echo $thumbnail; ?>
</a>

</div>
<br />

</div>

</div>
</div>

<?php
endwhile;
} elseif ( comicpress_themeinfo( 'display_archive_as_links' ) || comicpress_is_bbpress() ) {
?>

<div <?php post_class(); ?>>
<div <?php post_class(); ?>>

<div class="post-head"></div>
<div class="post-head"></div>

<div class="entry">
<div class="entry">

<table class="archive-table">
<table class="archive-table">

<?php
while ( have_posts() ) :
the_post();
?>
<?php
while ( have_posts() ) :
the_post();
?>

<tr>
<td class="archive-date">
<span class="archive-date-month-day">
<?php the_time( 'M d, ' ); ?>
</span>
<span class="archive-date-year">
<?php the_time( 'Y' ); ?>
</span>
</td>
<td class="archive-title">
<a href="<?php echo esc_html( get_permalink( $post->ID ) ); ?>" rel="bookmark" title="<?php esc_html_e( 'Permanent Link:', 'comicpress' ); ?> <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</td>
</tr>
<tr>
<td class="archive-date">
<span class="archive-date-month-day">
<?php the_time( 'M d, ' ); ?>
</span>
<span class="archive-date-year">
<?php the_time( 'Y' ); ?>
</span>
</td>
<td class="archive-title">
<a href="<?php echo esc_html( get_permalink( $post->ID ) ); ?>" rel="bookmark" title="<?php esc_html_e( 'Permanent Link:', 'comicpress' ); ?> <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</td>
</tr>

<?php
endwhile;
?>

</table>
?>

</div>
</table>

<div class="post-foot"></div>
</div>

<div class="post-foot"></div>

</div>

<?php
} else {
while ( have_posts() ) :
@@ -198,25 +200,26 @@
} else {
?>

<h2 class="page-title">
<?php echo esc_html( $title_string ); ?>
</h2>
<h2 class="page-title">
<?php echo esc_html( $title_string ); ?>
</h2>

<div class="archiveresults">
<div class="archiveresults">

<?php
printf(
/* translators: Number of found results */
esc_html( _n( '%d result', '%d results', $count, 'comicpress' ) ),
esc_html( $count )
);
?>
<?php
printf(
/* translators: Number of found results */
esc_html( _n( '%d result', '%d results', $count, 'comicpress' ) ),
esc_html( $count )
);
?>

</div>
</div>

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

<?php
}
get_footer();
?>
@@ -20,10 +20,13 @@
$curauth = get_user_by( 'slug', get_query_var( 'author_name' ) );
} else {
$curauth = get_userdata( get_query_var( 'author' ) );
} if ( empty( $curauth ) ) { ?>
} if ( empty( $curauth ) ) {
?>

<h2>

<?php esc_html_e( 'No such author.', 'comicpress' ); ?>

</h2>

<?php
@@ -61,7 +64,7 @@
?>

<h2>
<?php echo $authorname; ?>
<?php echo esc_html( $authorname ); ?>
</h2>

<?php
@@ -74,9 +77,7 @@
<?php esc_html_e( 'Registered on', 'comicpress' ); ?>
</td>
<td class="user-info-value">
<?php
echo date_i18n( get_option( 'date_format' ), strtotime( $curauth->user_registered ) );
?>
<?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $curauth->user_registered ) ) ); ?>
</td>
</tr>
<tr>
@@ -86,7 +87,7 @@
<td class="user-info-value">
<?php
$author_id = get_the_author_meta( 'ID' );
echo count_user_posts( $author_id );
echo esc_html( count_user_posts( $author_id ) );
?>
</td>
</tr>
@@ -108,8 +109,8 @@
<?php esc_html_e( 'Email', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="mailto://<?php echo $curauth->user_email; ?>" target="_blank">
<?php echo $curauth->user_email; ?>
<a href="mailto://<?php echo esc_html( $curauth->user_email ); ?>" target="_blank" rel="noopener noreferrer">
<?php echo esc_html( $curauth->user_email ); ?>
</a>
</td>
</tr>
@@ -124,8 +125,8 @@
<?php esc_html_e( 'Website', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->user_url; ?>" target="_blank">
<?php echo $curauth->user_url; ?>
<a href="<?php echo esc_html( $curauth->user_url ); ?>" target="_blank" rel="noopener noreferrer">
<?php echo esc_html( $curauth->user_url ); ?>
</a>
</td>
</tr>
@@ -139,8 +140,8 @@
<?php esc_html_e( 'Twitter', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->twitter; ?>" target="_blank">
<?php echo $curauth->twitter; ?>
<a href="<?php echo esc_html( $curauth->twitter ); ?>" target="_blank" rel="noopener noreferrer">
<?php echo esc_html( $curauth->twitter ); ?>
</a>
</td>
</tr>
@@ -155,8 +156,8 @@
<?php esc_html_e( 'Facebook', 'comicpress' ); ?>
</td>
<td class="user-contacts-url">
<a href="<?php echo $curauth->facebook; ?>" target="_blank">
<?php echo $curauth->facebook; ?>
<a href="<?php echo esc_html( $curauth->facebook ); ?>" target="_blank" rel="noopener noreferrer">
<?php echo esc_html( $curauth->facebook ); ?>
</a>
</td>
</tr>
@@ -175,9 +176,7 @@

<div class="userpage-desc">

<?php
echo $curauth->description;
?>
<?php echo esc_html( $curauth->description ); ?>

</div>

@@ -199,18 +198,20 @@
<?php
printf(
/* translators: Name of the author */
__( 'Posts by %1s &not; ', 'comicpress' ),
$authorname
esc_html__( 'Posts by %1s &not; ', 'comicpress' ),
esc_html( $authorname )
);
?>
</h3>
<br />

<table class="author-posts">
<?php
while ( have_posts() ) :
the_post();
?>

<?php
while ( have_posts() ) :
the_post();
?>

<tr>
<td class="author-archive-date" align="right">
<?php the_time( 'M j, Y' ); ?>
@@ -222,9 +223,9 @@
</td>
</tr>

<?php
<?php
endwhile;
?>
?>

</table>

0 comments on commit ecb51f8

Please sign in to comment.
You can’t perform that action at this time.