How can i change a line of code with equivalent one
-
I installed a theme on my website, https://packageslab.com/ but when I activate the theme I got an error: cannot call create function…. because of this line of code: add_action (‘widgets_init’, create_function (”, ‘return register_widget (“servies_menu_Widget”);’)); There some equivalent code I can do in place of this one
-
Hello,
create_function is deprecated long time ago. You can replace above line of code with below code.
function rc_services_menu_widget() { return register_widget('servies_menu_Widget'); } add_action ('widgets_init', 'rc_services_menu_widget');That will solve the error.
-
We can’t help you as your site isn’t running on the wordpress.com platform but uses the open source wordpress.org. Their support is at https://wordpress.org/support/
- The topic ‘How can i change a line of code with equivalent one’ is closed to new replies.