• Hi dears
    I have notice this error after enabling debugging

    Function create_function() is deprecated

    PHP Deprecated: Function create_function() is deprecated in /home/…../public_html/wp-content/plugins/wd-main-plugin/widgets/widget.php on line 65

    How should I correct it? anybody can help me rewrite the code in new version PHP?

    add_action(‘widgets_init’, create_function(”, ‘return register_widget(“wd_recent_post”);’));

    Thank you very much

Viewing 1 replies (of 1 total)
  • Instead of customizing the code yourself, you should contact the developer of the plugin. However, I can’t find it in the repository: https://wordpress.org/plugins/wd-main-plugin/

    Maybe it is already so outdated that you should not use it anymore OR it belongs to a commercial theme package that you have installed. In the latter case you should contact their support.

    In theory, the code should look right:

    add_action('widgets_init', function() { return register_widget("wd_recent_post"); });

    Untested.

Viewing 1 replies (of 1 total)
  • The topic ‘Function create_function() is deprecated’ is closed to new replies.