PluginProbe
Sight – Professional Image Gallery and Portfolio / trunk
Sight – Professional Image Gallery and Portfolio vtrunk
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 trunk, at elementor/integration.php

86 lines 1.9 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 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13
14 /**
15 * Class Sight_Elementor_Integraion
16 */
17 class Sight_Elementor_Integraion {
18
19 /**
20 * Instance
21 *
22 * @since 1.2.0
23 * @access private
24 * @static
25 *
26 * @var Sight_Elementor_Integraion The single instance of the class.
27 */
28 private static $_instance = null;
29
30 /**
31 * Instance
32 *
33 * Ensures only one instance of the class is loaded or can be loaded.
34 *
35 * @return Sight_Elementor_Integraion An instance of the class.
36 */
37 public static function instance() {
38 if ( is_null( self::$_instance ) ) {
39 self::$_instance = new self();
40 }
41 return self::$_instance;
42 }
43
44 /**
45 * Register Сontrols
46 *
47 * Register new Elementor controls.
48 */
49 public function register_controls() {
50 // Its is now safe to include Сontrols files.
51 require_once SIGHT_PATH . 'elementor/control-custom-post.php';
52
53 // Register Сontrols.
54 \Elementor\Plugin::instance()->controls_manager->register_control( 'custom_post', new Controls\Sight_Control_Custom_Post() );
55 }
56
57 /**
58 * Register Widgets
59 *
60 * Register new Elementor widgets.
61 */
62 public function register_widgets() {
63 // Its is now safe to include Widgets files.
64 require_once SIGHT_PATH . 'elementor/widget-portfolio.php';
65
66 // Register Widgets.
67 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Sight_Widget_Portfolio() );
68 }
69
70 /**
71 * Plugin class constructor
72 *
73 * Register plugin action hooks and filters
74 */
75 public function __construct() {
76 require_once SIGHT_PATH . 'elementor/helper.php';
77
78 // Actions registered.
79 add_action( 'elementor/controls/controls_registered', array( $this, 'register_controls' ) );
80 add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
81 }
82 }
83
84 // Instantiate Sight_Elementor_Integraion Class.
85 Sight_Elementor_Integraion::instance();
86