Skip to content
Advertisement

add_action gives error when call my function

I have below code but wp says me:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘widget_categories’ not found or invalid function name in /home/deniztas/hekim.deniz-tasarim.site/wp-includes/class-wp-hook.php on line 287

So, why I cant add the function? What must I do?

JavaScript

Advertisement

Answer

I think you want to add widget categories in Elementor to organize the widgets into groups (please be more clear about the goal you want to reach in your question next time). So if this is what you want to achieve, your plugin code should look like this:

JavaScript

I found the correct structure in the documentation: https://developers.elementor.com/widget-categories/

You don’t need the class and all the other stuff, you can just hook in with add_action.

Hope this helps.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement