PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.4.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.4.0
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 3.5.2 All 199 releases
betterdocs / includes / Editors / Elementor / Helper.php

Helper.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.4.0, at includes/Editors/Elementor/Helper.php

64 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WPDeveloper\BetterDocs\Editors\Elementor;
3 use WPDeveloper\BetterDocs\Core\Query;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly
7 }
8
9 use WPDeveloper\BetterDocs\Utils\Base;
10
11 class Helper extends Base {
12 /**
13 * Summary of query
14 * @var Query
15 */
16 private $query;
17
18 public function __construct( Query $query ) {
19 $this->query = $query;
20 }
21
22 public function orderby_options() {
23 $orderby = [
24 'ID' => 'Docs ID',
25 'author' => 'Docs Author',
26 'title' => 'Title',
27 'date' => 'Date',
28 'modified' => 'Last Modified Date',
29 'parent' => 'Parent Id',
30 'rand' => 'Random',
31 'comment_count' => 'Comment Count',
32 'menu_order' => 'Menu Order',
33 'betterdocs_order' => 'BetterDocs Order'
34 ];
35
36 return $orderby;
37 }
38
39 /**
40 * Get Post Categories
41 *
42 * @return array
43 */
44 public function get_terms( $taxonomy = 'category', $key = 'term_id' ) {
45 $options = [];
46 $terms = get_terms( [
47 'taxonomy' => $taxonomy,
48 'hide_empty' => true
49 ] );
50
51 if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
52 foreach ( $terms as $term ) {
53 $options[$term->{$key}] = $term->name;
54 }
55 }
56
57 return $options;
58 }
59
60 public function get_faq_terms() {
61 return $this->query->get_faq_terms();
62 }
63 }
64