PluginProbe
Elementor Website Builder – more than just a page builder / 3.6.0-dev1
Elementor Website Builder – more than just a page builder v3.6.0-dev1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / library / documents / library-document.php

library-document.php in Elementor Website Builder – more than just a page builder 3.6.0-dev1, at modules/library/documents/library-document.php

78 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\Library\Documents;
3
4 use Elementor\Core\Base\Document;
5 use Elementor\Modules\Library\Traits\Library;
6 use Elementor\TemplateLibrary\Source_Local;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly
10 }
11
12 /**
13 * Elementor library document.
14 *
15 * Elementor library document handler class is responsible for handling
16 * a document of the library type.
17 *
18 * @since 2.0.0
19 */
20 abstract class Library_Document extends Document {
21
22 // Library Document Trait
23 use Library;
24
25 /**
26 * The taxonomy type slug for the library document.
27 */
28 const TAXONOMY_TYPE_SLUG = 'elementor_library_type';
29
30 /**
31 * Get document properties.
32 *
33 * Retrieve the document properties.
34 *
35 * @since 2.0.0
36 * @access public
37 * @static
38 *
39 * @return array Document properties.
40 */
41 public static function get_properties() {
42 $properties = parent::get_properties();
43
44 $properties['admin_tab_group'] = 'library';
45 $properties['show_in_library'] = true;
46 $properties['register_type'] = true;
47 $properties['cpt'] = [ Source_Local::CPT ];
48
49 // TODO: Remove - Backwards compatibility, since 'Theme_Document' does not support 'static::get_type'.
50 $properties['show_in_finder'] = false;
51
52 return $properties;
53 }
54
55 /**
56 * Get initial config.
57 *
58 * Retrieve the current element initial configuration.
59 *
60 * Adds more configuration on top of the controls list and the tabs assigned
61 * to the control. This method also adds element name, type, icon and more.
62 *
63 * @since 2.9.0
64 * @access protected
65 *
66 * @return array The initial config.
67 */
68 public function get_initial_config() {
69 $config = parent::get_initial_config();
70
71 $config['library'] = [
72 'save_as_same_type' => true,
73 ];
74
75 return $config;
76 }
77 }
78