PluginProbe
Hello Plus / trunk
Hello Plus vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / theme / module.php

module.php in Hello Plus trunk, at modules/theme/module.php

96 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\Theme;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 use HelloPlus\Includes\Module_Base;
10
11 /**
12 * Theme module
13 *
14 * @package HelloPlus
15 * @subpackage HelloPlusModules
16 */
17 class Module extends Module_Base {
18 const HELLOPLUS_EDITOR_CATEGORY_SLUG = 'helloplus';
19
20 /**
21 * @inheritDoc
22 */
23 public static function get_name(): string {
24 return 'theme';
25 }
26
27 /**
28 * @inheritDoc
29 */
30 protected function get_component_ids(): array {
31 return [
32 'Theme_Overrides',
33 'Theme_Dependency',
34 ];
35 }
36
37 public function register_styles(): void {
38 wp_register_style(
39 'helloplus-button',
40 HELLOPLUS_STYLE_URL . 'helloplus-button.css',
41 [ 'elementor-frontend' ],
42 HELLOPLUS_VERSION
43 );
44
45 wp_register_style(
46 'helloplus-image',
47 HELLOPLUS_STYLE_URL . 'helloplus-image.css',
48 [ 'elementor-frontend' ],
49 HELLOPLUS_VERSION
50 );
51
52 wp_register_style(
53 'helloplus-shapes',
54 HELLOPLUS_STYLE_URL . 'helloplus-shapes.css',
55 [ 'elementor-frontend' ],
56 HELLOPLUS_VERSION
57 );
58
59 wp_register_style(
60 'helloplus-column-structure',
61 HELLOPLUS_STYLE_URL . 'helloplus-column-structure.css',
62 [ 'elementor-frontend' ],
63 HELLOPLUS_VERSION
64 );
65 }
66
67 /**
68 * @param \Elementor\Elements_Manager $elements_manager
69 *
70 * @return void
71 */
72 public function add_hello_plus_e_panel_categories( \Elementor\Elements_Manager $elements_manager ) {
73 $categories = $elements_manager->get_categories();
74 if ( ! empty( $categories[ self::HELLOPLUS_EDITOR_CATEGORY_SLUG ] ) ) {
75 return;
76 }
77
78 $elements_manager->add_category(
79 self::HELLOPLUS_EDITOR_CATEGORY_SLUG,
80 [
81 'title' => esc_html__( 'Hello+', 'hello-plus' ),
82 'icon' => 'fa fa-plug',
83 ]
84 );
85 }
86
87 /**
88 * @inheritDoc
89 */
90 protected function register_hooks(): void {
91 parent::register_hooks();
92 add_action( 'elementor/elements/categories_registered', [ $this, 'add_hello_plus_e_panel_categories' ] );
93 add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_styles' ] );
94 }
95 }
96