PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.2
Elementor Website Builder – more than just a page builder v4.2.2
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 / global-classes / utils / kit-utils.php

kit-utils.php in Elementor Website Builder – more than just a page builder 4.2.2, at modules/global-classes/utils/kit-utils.php

49 lines 996 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\GlobalClasses\Utils;
4
5 use Elementor\Core\Base\Document;
6 use Elementor\Core\Kits\Documents\Kit;
7 use Elementor\Plugin;
8 use Elementor\TemplateLibrary\Source_Local;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13
14 class Kit_Utils {
15 /**
16 * Returns all kit documents on the current site.
17 *
18 * @return Kit[]
19 */
20 public static function get_all_kit_documents(): array {
21 $kit_ids = get_posts( [
22 'post_type' => Source_Local::CPT,
23 'post_status' => 'any',
24 'fields' => 'ids',
25 'posts_per_page' => -1,
26 'no_found_rows' => true,
27 'update_post_meta_cache' => false,
28 'meta_query' => [
29 [
30 'key' => Document::TYPE_META_KEY,
31 'value' => 'kit',
32 ],
33 ],
34 ] );
35
36 $kits = [];
37
38 foreach ( $kit_ids as $kit_id ) {
39 $kit = Plugin::$instance->kits_manager->get_kit( $kit_id );
40
41 if ( $kit ) {
42 $kits[] = $kit;
43 }
44 }
45
46 return $kits;
47 }
48 }
49