PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.7
Elementor Website Builder – more than just a page builder v3.0.7
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 / core / base / app.php

app.php in Elementor Website Builder – more than just a page builder 3.0.7, at core/base/app.php

65 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Core\Base;
4
5 use Elementor\Utils;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly
9 }
10
11 /**
12 * Base App
13 *
14 * Base app utility class that provides shared functionality of apps.
15 *
16 * @since 2.3.0
17 */
18 abstract class App extends Module {
19
20 /**
21 * Print config.
22 *
23 * Used to print the app and its components settings as a JavaScript object.
24 *
25 * @param string $handle Optional
26 *
27 * @since 2.3.0
28 * @since 2.6.0 added the `$handle` parameter
29 * @access protected
30 */
31 final protected function print_config( $handle = null ) {
32 $name = $this->get_name();
33
34 $js_var = 'elementor' . str_replace( ' ', '', ucwords( str_replace( '-', ' ', $name ) ) ) . 'Config';
35
36 $config = $this->get_settings() + $this->get_components_config();
37
38 if ( ! $handle ) {
39 $handle = 'elementor-' . $name;
40 }
41
42 Utils::print_js_config( $handle, $js_var, $config );
43 }
44
45 /**
46 * Get components config.
47 *
48 * Retrieves the app components settings.
49 *
50 * @since 2.3.0
51 * @access private
52 *
53 * @return array
54 */
55 private function get_components_config() {
56 $settings = [];
57
58 foreach ( $this->get_components() as $id => $instance ) {
59 $settings[ $id ] = $instance->get_settings();
60 }
61
62 return $settings;
63 }
64 }
65