I am working on a WordPres plugin.
Now i want to add an catogory to the elementor plugin.
I can’t find out how to do this from my plugin only.
My current code:
add_action( 'elementor/elements/categories_registered', 'add_elementor_widget_categories' );
function add_elementor_widget_categories( $elements_manager ) {
$elements_manager->add_category(
' first-category',
[
'title' => __( 'First Category', 'plugin-name' ),
'icon' => 'fa fa-plug',
]
);
$elements_manager->add_category(
'second-category',
[
'title' => __( 'Second Category', 'plugin-name' ),
'icon' => 'fa fa-plug',
]
);
}
Does anyone know how to do what I want?
2
Answers
My code was corract all along the only thing was that there where no widgets attached to it. Big mistake on me!
Now Simply add any widget in this category ::