I want to add a new category to element editor on wordpress.
I found the link https://developers.elementor.com/creating-a-new-widget/,
but I don’ t know what to do. Because I am a beginner.
How to add that codes, to what file.
I mean step by step.
How to make a php file in any path, and how to include that php file?
I can create a new php file for it? or insert them to current elementor php file?
2
Answers
Create a separate file ( e.g: helper.php) in your plugin folder and include it into your main plugin loader file. paste the following code into the helper file. And that will create a separate category in the Elementor’s widget sidebar.
As like the documentation: Getting Started for extending Elementor
Create a custom plugin first, hope you know How to create a custom plugin: Create plugins in wordpress
A short demo:
Remember full Elementor core is written in OOP.
Assuming the plugin name as ElementorTest
Now, we need to make sure that no direct access is given to our plugin php files, and let us create the basic skeleton for creating an extension/widget via Elementor.Ref: Initialize the plugin
Now create a class under youtplugin/widgets/test-widget.php. Ref: Creating the core widget functionality
Rest are pretty self explanatory. For widget category the skeleton is also similar. Hope this will help.