PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
← All changes | views/widgets/author.php +14 -24 4.8.23.8.9 View file →
@@ -1,26 +1,16 @@
1 -<?php
2 -// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.
1 +<div class="betterdocs-author-date">
2 + <div class="betterdocs-author">
3 + <?php
4 + // Get the author's ID
5 + $author_id = get_post_field( 'post_author', get_the_ID() );
3 6
4 -
5 -if ( ! defined( 'ABSPATH' ) ) {
6 - exit;
7 -}
8 -// Get the author's ID
9 - $author_id = get_post_field( 'post_author', get_the_ID() );
7 + // Get the author's avatar with a specified size
8 + $avatar_size = 40;
9 + $author_avatar = get_avatar( $author_id, $avatar_size );
10 10
11 - // Get the author's avatar with a specified size
12 - $avatar_size = 40;
13 - $author_avatar = get_avatar( $author_id, $avatar_size );
14 - $authors_url = site_url() . '/' . betterdocs()->settings->get( 'docs_slug' ) . '/authors/' . $author_id . '/page/1';
15 -
16 -?>
17 -
18 -<a class="betterdocs-author-date" href="<?php echo esc_url( $authors_url ); ?>">
19 - <div class="betterdocs-author">
20 - <?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>';
23 - ?>
24 - </div>
25 - <?php betterdocs()->views->get( 'template-parts/update-date' );?>
26 -</a>
11 + echo '<div class="author-avatar">' . $author_avatar . '</div>'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
12 + echo '<span>' . get_the_author_meta( 'display_name', $author_id ) . '</span>'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
13 + ?>
14 + </div>
15 + <?php betterdocs()->views->get( 'template-parts/update-date' ); ?>
16 +</div>