PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.3
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.3
4.9.3 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 All 201 releases
betterdocs / views / templates / parts / author.php

author.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.3, at views/templates/parts/author.php

29 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7 // Get the author's ID
8 $author_id = get_post_field( 'post_author', get_the_ID() );
9
10 // Get the author's avatar with a specified size
11 $avatar_size = 40;
12 $author_avatar = get_avatar( $author_id, $avatar_size );
13 $authors_url = site_url() . '/'.betterdocs()->settings->get('docs_slug').'/authors/' . $author_id . '/page/1';
14 ?>
15
16 <a class="betterdocs-author-date" href="<?php echo esc_url( $authors_url ); ?>">
17 <div class="betterdocs-author">
18 <?php
19 echo '<div class="author-avatar">' . wp_kses_post( $author_avatar ) . '</div>';
20 echo '<span>' . esc_html( get_the_author_meta( 'display_name', $author_id ) ) . '</span>';
21 ?>
22 </div>
23 <?php
24 if ( isset( $updated_date ) && $updated_date == true ) {
25 betterdocs()->views->get( 'template-parts/update-date' );
26 }
27 ?>
28 </a>
29