升级PHP7.2后提示“Warning: Use of undefined constant px…”
三好酋长在把环境升级到PHP7.2后,网站上遇到了一系列小错误,这次是《三好网志》侧边栏的“热门标签处”显示警告:
Warning: Use of undefined constant px – assumed ‘px’ (this will throw an Error in a future version of PHP) in /wp-content/themes/Ality/inc/functions/widgets.php on line 291
查看widgets.php的291行,看到其中有:
‘unit’ => px,
把它修改为:
‘unit’ => ‘px’,
症状消失,也不知是不是真正解决了问题,先在这里记录一下备忘吧。
感谢感谢!!为啥加引号就可以了。