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 / template-parts / archive-doc-list.php

archive-doc-list.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.3, at views/template-parts/archive-doc-list.php

54 lines 1.7 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 if ( ! isset( $current_category ) || $current_category === null ) {
8 return;
9 }
10 ?>
11
12 <div class="betterdocs-title-excerpt-lists">
13 <?php
14 $custom_icon = betterdocs()->customizer->defaults->get( 'betterdocs_archive_list_icon' );
15 $settings_list_icon = betterdocs()->settings->get( 'docs_list_icon' );
16 if ( ! $custom_icon && $settings_list_icon ) {
17 $custom_icon = $settings_list_icon['url'];
18 }
19
20 if ( $post_query->have_posts() ) :
21 while ( $post_query->have_posts() ) :
22 $post_query->the_post();
23 $title_tag = isset( $docs_list_title_tag ) ? $docs_list_title_tag : 'h2';
24 $title_tag = betterdocs()->template_helper->is_valid_tag( $title_tag );
25 ?>
26 <div class="betterdocs-title-excerpt-list">
27 <<?php echo esc_attr( $title_tag ); ?> class="betterdocs-entry-title">
28 <span><?php betterdocs()->template_helper->icon( 'docs-icon', true ); ?></span>
29 <a href="<?php echo esc_url( get_the_permalink() ); ?>">
30 <?php echo esc_html( get_the_title() ); ?>
31 </a>
32 </<?php echo esc_attr( $title_tag ); ?>>
33 <?php
34 echo wp_sprintf( '<span class="update-date">%s %s</span>', esc_html__( 'Last Updated:', 'betterdocs' ), get_the_modified_date() ); //phpcs:ignore
35
36 add_filter(
37 'excerpt_more',
38 function () {
39 return '...'; // Replace '[…]' with '...'
40 }
41 );
42
43 echo '<p>' . esc_html( get_the_excerpt() ) . '</p>';
44
45 remove_filter( 'excerpt_more', '__return_empty_string' );
46 ?>
47 </div>
48 <?php
49 endwhile;
50 wp_reset_postdata();
51 endif;
52 ?>
53 </div>
54