| @@ -1,12 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | -// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 3 | 2 | |
| 4 | - | |
| 5 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | - exit; | |
| 7 | -} | |
| 8 | -// Get the author's ID | |
| 3 | + // Get the author's ID | |
| 9 | 4 | $author_id = get_post_field( 'post_author', get_the_ID() ); |
| 10 | 5 | |
| 11 | 6 | // Get the author's avatar with a specified size |
| 12 | 7 | $avatar_size = 40; |
| @@ -14,13 +9,13 @@ | ||
| 14 | 9 | $authors_url = site_url() . '/' . betterdocs()->settings->get( 'docs_slug' ) . '/authors/' . $author_id . '/page/1'; |
| 15 | 10 | |
| 16 | 11 | ?> |
| 17 | 12 | |
| 18 | -<a class="betterdocs-author-date" href="<?php echo esc_url( $authors_url ); ?>"> | |
| 13 | +<a class="betterdocs-author-date" href="<?php echo $authors_url; ?>"> | |
| 19 | 14 | <div class="betterdocs-author"> |
| 20 | 15 | <?php |
| 21 | - echo '<div class="author-avatar">' . wp_kses_post( $author_avatar ) . '</div>'; | |
| 22 | - echo '<span>' . esc_html( get_the_author_meta( 'display_name', $author_id ) ) . '</span>'; | |
| 16 | + echo '<div class="author-avatar">' . $author_avatar . '</div>'; | |
| 17 | + echo '<span>' . get_the_author_meta( 'display_name', $author_id ) . '</span>'; | |
| 23 | 18 | ?> |
| 24 | 19 | </div> |
| 25 | 20 | <?php betterdocs()->views->get( 'template-parts/update-date' );?> |
| 26 | 21 | </a> |