PHP 7.3函数create_function()已过时-[重复]

这个问题已经在这里有了答案:

PHP 7.2函数create_function()已弃用(4个答案)

7个月前关闭。

我在下面的wordpress主题中使用过create_function。

add_filter('document_title_separator', create_function('', 'return "|";'));

add_filter('the_generator', create_function('', 'return "";'));

但是对于PHP 7.3, 不建议使用create_function()。

任何想法, 如何在PHP 7.3上修复我的代码。

谢谢你的帮助,

我尝试了这个, 但是没有用:

add_filter('document_title_separator', function() {return |;});

add_filter('the_generator', function() {return ;'});

#1


你的代码中存在语法错误, 请尝试以下操作:

add_filter('document_title_separator', function() {return '|';});

add_filter('the_generator', function() {return ;});

而且你总是可以像这样使用传统方式

add_filter('the_generator' , 'my_generator_function');
function my_generator_function(){
    return;
}

提示:使用发生语法错误时通知你的IDE

来源:

https://www.srcmini02.com/63756.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37577.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?