Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,16 +424,6 @@ public function register_controls() {
public function elementor_init() {
$this->modules_manager = new Modules_Manager();
$this->_extensions_manager = new Extensions_Manager();

// Add element category in panel
\Elementor\Plugin::instance()->elements_manager->add_category(
'powerpack-elements', // This is the name of your addon's category and will be used to group your widgets/elements in the Edit sidebar pane!
[
'title' => __( 'PowerPack Elements', 'powerpack' ), // The title of your modules category - keep it simple and short!
'icon' => 'font',
],
1
);
}

public function get_promotion_widgets( $config ) {
Expand All @@ -457,8 +447,29 @@ public function get_promotion_widgets( $config ) {
return $config;
}

/**
* Register Elementor widget category
*
* @since x.x.x
* @access public
*
* @param ElementorElements_Manager $manager Elements manager.
*/
public function register_category( $manager ) {
// Add element category in panel
$manager->add_category(
'powerpack-elements', // This is the name of your addon's category and will be used to group your widgets/elements in the Edit sidebar pane!
[
'title' => __( 'PowerPack Elements', 'powerpack' ), // The title of your modules category - keep it simple and short!
'icon' => 'font',
],
1
);
}

protected function add_actions() {
add_action( 'elementor/init', [ $this, 'elementor_init' ] );
add_action( 'elementor/elements/categories_registered', [ $this, 'register_category' ] );

add_action( 'elementor/controls/controls_registered', [ $this, 'register_controls' ] );
add_action( 'elementor/controls/controls_registered', [ $this, 'include_group_controls' ] );
Expand Down