Skip to content

Instantly share code, notes, and snippets.

@iqbalrony
Forked from sh-sabbir/functions.php
Created May 10, 2021 17:04
Show Gist options
  • Save iqbalrony/8ef2017dcce9d35b2d9a6762a87e649c to your computer and use it in GitHub Desktop.
Save iqbalrony/8ef2017dcce9d35b2d9a6762a87e649c 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