Skip to content

Instantly share code, notes, and snippets.

@sh-sabbir
Created May 10, 2021 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sh-sabbir/5fc704086de88e42fe1a6ff1423dec5e to your computer and use it in GitHub Desktop.
Save sh-sabbir/5fc704086de88e42fe1a6ff1423dec5e to your computer and use it in GitHub Desktop.
Elementor Widget category re-order
<?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