小编Say*_*tta的帖子

如何修复 wordpress 站点中 create_function 的弃用问题?

public static function registerWidget($widgetName){
    add_action('widgets_init', create_function('', 'return register_widget("'.$widgetName.'");'));
Run Code Online (Sandbox Code Playgroud)

这是我的代码,警告是:

"Deprecated: Function create_function() is deprecated in xxx.php" on 258 line

我怎样才能解决这个问题?

error-handling

4
推荐指数
1
解决办法
1642
查看次数

标签 统计

error-handling ×1