php警告Creating default object from empty value 问题的解决方法

2026-01-16 16:51:58 作者:用户投稿

解决方法是找到报错的位置然后看哪个变量是没有初始化而直接使用的,将这个变量先实例化一个空类。如:
复制代码 代码如下:$ct = new stdClass();
修改文件相应代码,如:
复制代码 代码如下:if ( ! isset( $themes[$current_theme] ) ) {
 delete_option( 'current_theme' );
 $current_theme = get_current_theme();
}
$ct = new stdClass(); <!--添加这行-->
$ct->name = $current_theme;
问题解决。

猜你喜欢

联络方式:

400 9058 355

邮箱:8955556@qq.com

Q Q:8955556

微信二维码
在线咨询 拨打电话

电话

400 9058 355

微信二维码

微信二维码