# betterdocs/2.0.14/includes/elementor/betterdocs-doc-archive.php

BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ &amp; Chatbot, version 2.0.14. 115 lines.

- Page: https://pluginprobe.com/plugins/betterdocs/2.0.14/code/includes/elementor/betterdocs-doc-archive.php
- Raw: https://pluginprobe.com/plugins/betterdocs/2.0.14/raw/includes/elementor/betterdocs-doc-archive.php
- Modified: 2022-02-15T10:03:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/betterdocs/2.0.14/code/includes/elementor/betterdocs-doc-archive.php#L10-L20`.

```php
<?php

use ElementorPro\Modules\ThemeBuilder\Documents\Archive;

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}

class Betterdocs_Doc_Archive extends Archive
{
    public static function get_properties()
    {
        $properties = parent::get_properties();

        $properties['location'] = 'archive';
        $properties['condition_type'] = 'doc_archive';

        return $properties;
    }

    public static function get_type() {
        return 'doc-archive';
    }

    public static function get_title()
    {
        return __('Docs Archive', 'betterdocs');
    }

    public static function get_plural_title() {
        return esc_html__( 'Docs Archives', 'betterdocs' );
    }

    protected static function get_site_editor_icon() {
        return 'eicon-products';
    }

    public static function get_preview_as_default() {
        return 'post_type_archive/docs';
    }

    public static function get_preview_as_options() {
        $post_type_archives = [];
        $taxonomies = [];
        $post_type = 'docs';

        $post_type_object = get_post_type_object( $post_type );

        $post_type_archives[ 'post_type_archive/' . $post_type ] = $post_type_object->label . ' ' . esc_html__( 'Archive', 'elementor-pro' );

        $post_type_taxonomies = get_object_taxonomies( $post_type, 'objects' );

        $post_type_taxonomies = wp_filter_object_list( $post_type_taxonomies, [
            'public' => true,
            'show_in_nav_menus' => true,
        ] );

        foreach ( $post_type_taxonomies as $slug => $object ) {
            $taxonomies[ 'taxonomy/' . $slug ] = $object->label . ' ' . esc_html__( 'Archive', 'elementor-pro' );
        }

        $options = [
            'search' => esc_html__( 'Search Results', 'elementor-pro' ),
        ];

        $options += $taxonomies + $post_type_archives;

        return [
            'archive' => [
                'label' => esc_html__( 'Archive', 'elementor-pro' ),
                'options' => $options,
            ],
        ];
    }

    protected static function get_editor_panel_categories()
    {
        $categories = [
            'docs-archive' => [
                'title' => __('Docs Archive', 'betterdocs'),
            ],
        ];
        $categories += parent::get_editor_panel_categories();
        unset($categories['theme-elements-archive']);
        return $categories;
    }

    public static function get_editor_panel_config()
    {
        $config = parent::get_editor_panel_config();
        $config['widgets_settings']['theme-archive-title']['categories'][] = 'docs-archive';
        return $config;
    }

    protected function register_controls() {
        parent::register_controls();

        $this->update_control(
            'preview_type',
            [
                'default' => 'post_type_archive/docs',
            ]
        );
    }

    protected function get_remote_library_config()
    {
        $config = parent::get_remote_library_config();

        $config['category'] = 'Docs Archive';

        return $config;
    }
}

```
