我在Wordpress中收到警告信息:
“从空值中创建默认对象 /home/forthemde/public_html/wp-content/themes/mayadeep/admin/admin.php 在线225“
此处的代码位于admin.php
和:
function upfw_setup_theme_options(){
$up_options_db = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
global $up_options;
//Check if options are stored properly
if( isset($up_options_db) && is_array($up_options_db) ):
//Check array to an object
foreach ($up_options_db as $k => $v) {
$up_options -> {$k} = $v;
}
else:
do_action('upfw_theme_activation');
endif;
}
add_action('upfw_theme_init','upfw_setup_theme_options',10);
add_action('upfw_admin_init','upfw_setup_theme_options',100);
第225行在这里:
$up_options -> {$k} = $v;
我试着自己解决,但没有结果。请帮助我,非常感谢您的帮助。
问候。
答案 0 :(得分:1)
最近我也有这个问题,但这对我有用:
在$up_options = new stdClass();
global $up_options;