Created
December 11, 2020 10:44
-
-
Save obiPlabon/36efff94fd525ba8bad544d3873d27a3 to your computer and use it in GitHub Desktop.
Asssign any elementor widget to a different category
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 | |
/** | |
* Asssign any elementor widget to a different category | |
* | |
* To override the existing category just pass [ 'your-custom-category' ] | |
* And to keep existing [ 'your-custom-category', 'basic' ] | |
* here 'your-custom-category' is any registered category slug | |
* | |
* @param array $config | |
* | |
* @author obiPlabon <https://obiplabon.im> | |
*/ | |
add_filter( 'elementor/document/config', function ( $config ) { | |
// 'text-editor' is the Text Editor widget | |
// 'heading' is the Heading widget | |
// @see get_name method in widget class | |
$config['widgets']['text-editor']['categories'] = [ 'your-custom-category' ]; | |
return $config; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code preview was created using Carbon.now.sh