PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.82
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.82
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / helpers / Loop_Builder / Document.php

Document.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.82, at includes/helpers/Loop_Builder/Document.php

84 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor document type for Loop Builder item templates.
4 *
5 * @package King_Addons
6 */
7
8 namespace King_Addons\Loop_Builder;
9
10 use Elementor\Core\DocumentTypes\Post;
11
12 if (!defined('ABSPATH')) {
13 exit;
14 }
15
16 /**
17 * One repeated card, designed in Elementor and rendered per post by Loop Grid.
18 */
19 class Document extends Post
20 {
21 /**
22 * Meta key holding the post type a template was designed for.
23 */
24 public const META_SOURCE = 'ka_loop_source';
25
26 /**
27 * Meta key holding the post used for the editor preview.
28 */
29 public const META_PREVIEW_ID = 'ka_loop_preview_id';
30
31 /**
32 * Document type name.
33 *
34 * @return string
35 */
36 public static function get_type(): string
37 {
38 return 'king-addons-loop-item';
39 }
40
41 /**
42 * Document type title.
43 *
44 * @return string
45 */
46 public static function get_title(): string
47 {
48 return esc_html__('Loop Item', 'king-addons');
49 }
50
51 /**
52 * Document properties.
53 *
54 * @return array<string,mixed>
55 */
56 public static function get_properties(): array
57 {
58 return array_merge(parent::get_properties(), [
59 'location' => 'king-addons-loop',
60 'support_wp_page_templates' => false,
61 'support_site_editor' => false,
62 'has_elements' => true,
63 'support_kit' => true,
64 'cpt' => ['elementor_library'],
65 ]);
66 }
67
68 /**
69 * Open the template straight in the editor from the library list.
70 *
71 * @return string
72 */
73 public function get_edit_url(): string
74 {
75 $url = parent::get_edit_url();
76
77 if ($url) {
78 $url = add_query_arg('action', 'elementor', $url);
79 }
80
81 return $url;
82 }
83 }
84