Created
May 10, 2021 17:03
-
-
Save sh-sabbir/5fc704086de88e42fe1a6ff1423dec5e to your computer and use it in GitHub Desktop.
Elementor Widget category re-order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_elementor_widget_categories( $elements_manager ) { | |
$categories = []; | |
$categories['oceanic'] = | |
[ | |
'title' => 'Oceanic Widgets', | |
'icon' => 'fa fa-plug' | |
]; | |
$old_categories = $elements_manager->get_categories(); | |
$categories = array_merge($categories, $old_categories); | |
$set_categories = function ( $categories ) { | |
$this->categories = $categories; | |
}; | |
$set_categories->call( $elements_manager, $categories ); | |
} | |
add_action( 'elementor/elements/categories_registered', 'add_elementor_widget_categories') ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment