PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.6.1
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.6.1
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 4.6.1, at includes/Editors/Elementor/Helper.php

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