1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
<?php namespace Elementor\Modules\LandingPages\Documents;
use Elementor\Core\DocumentTypes\PageBase; use Elementor\Modules\LandingPages\Module as Landing_Pages_Module; use Elementor\Modules\Library\Traits\Library; use Elementor\Modules\PageTemplates\Module as Page_Templates_Module; use Elementor\Plugin; use Elementor\TemplateLibrary\Source_Local;
if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly }
class Landing_Page extends PageBase {
// Library Document Trait use Library;
public static function get_properties() { $properties = parent::get_properties();
$properties['support_kit'] = true; $properties['show_in_library'] = true; $properties['cpt'] = [ Landing_Pages_Module::CPT ];
return $properties; }
public static function get_type() { return Landing_Pages_Module::DOCUMENT_TYPE; }
/** * @access public */ public function get_name() { return Landing_Pages_Module::DOCUMENT_TYPE; }
/** * @access public * @static */ public static function get_title() { return esc_html__( 'Landing Page', 'elementor' ); }
/** * @access public * @static */ public static function get_plural_title() { return esc_html__( 'Landing Pages', 'elementor' ); }
public static function get_create_url() { return parent::get_create_url() . '#library'; }
/** * Save Document. * * Save an Elementor document. * * @since 3.1.0 * @access public * * @param $data * * @return bool */ public function save( $data ) { // This is for the first time a Landing Page is created. It is done in order to load a new Landing Page with // 'Canvas' as the default page template. if ( empty( $data['settings']['template'] ) ) { $data['settings']['template'] = Page_Templates_Module::TEMPLATE_CANVAS; }
return parent::save( $data ); }
/** * Admin Columns Content * * @since 3.1.0 * * @param $column_name * @access public */ public function admin_columns_content( $column_name ) { if ( 'elementor_library_type' === $column_name ) { $this->print_admin_column_type(); } }
protected function get_remote_library_config() { $config = [ 'type' => 'lp', 'default_route' => 'templates/landing-pages', 'autoImportSettings' => true, ];
return array_replace_recursive( parent::get_remote_library_config(), $config ); } }
|