PluginProbe
Sight – Professional Image Gallery and Portfolio / 1.0.6
Sight – Professional Image Gallery and Portfolio v1.0.6
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8
sight / elementor / integration.php

integration.php in Sight – Professional Image Gallery and Portfolio 1.0.6, at elementor/integration.php

82 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Support Elementor.
4 *
5 * @package Sight
6 */
7
8 namespace Sight_Elementor;
9
10 /**
11 * Class Sight_Elementor_Integraion
12 */
13 class Sight_Elementor_Integraion {
14
15 /**
16 * Instance
17 *
18 * @since 1.2.0
19 * @access private
20 * @static
21 *
22 * @var Sight_Elementor_Integraion The single instance of the class.
23 */
24 private static $_instance = null;
25
26 /**
27 * Instance
28 *
29 * Ensures only one instance of the class is loaded or can be loaded.
30 *
31 * @return Sight_Elementor_Integraion An instance of the class.
32 */
33 public static function instance() {
34 if ( is_null( self::$_instance ) ) {
35 self::$_instance = new self();
36 }
37 return self::$_instance;
38 }
39
40 /**
41 * Register Сontrols
42 *
43 * Register new Elementor controls.
44 */
45 public function register_controls() {
46 // Its is now safe to include Сontrols files.
47 require_once SIGHT_PATH . 'elementor/control-custom-post.php';
48
49 // Register Сontrols.
50 \Elementor\Plugin::instance()->controls_manager->register_control( 'custom_post', new Controls\Sight_Control_Custom_Post() );
51 }
52
53 /**
54 * Register Widgets
55 *
56 * Register new Elementor widgets.
57 */
58 public function register_widgets() {
59 // Its is now safe to include Widgets files.
60 require_once SIGHT_PATH . 'elementor/widget-portfolio.php';
61
62 // Register Widgets.
63 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Sight_Widget_Portfolio() );
64 }
65
66 /**
67 * Plugin class constructor
68 *
69 * Register plugin action hooks and filters
70 */
71 public function __construct() {
72 require_once SIGHT_PATH . 'elementor/helper.php';
73
74 // Actions registered.
75 add_action( 'elementor/controls/controls_registered', array( $this, 'register_controls' ) );
76 add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
77 }
78 }
79
80 // Instantiate Sight_Elementor_Integraion Class.
81 Sight_Elementor_Integraion::instance();
82