本人’;我正在尝试将WP安装从4.0.6升级到4.4.2。大部分更新进行得很顺利,但我’;我可以’;我似乎不明白:
Warning: Creating default object from empty value in /nas/content/staging/thebaffler/wp-content/themes/baffler/inc/custom-posts.php on line 216
该错误似乎是由主题文件引发的,该文件重命名了WP用于‘;邮政编码’;内容类型。什么’;奇怪的是,所有‘;邮政编码’;标签仍将使用主题文件‘;自定义帖子’;
此处’;是有问题的代码片段。214是这里摘录的第一行。如果我对第216行进行注释,则错误消息指代215:
$labels = &$wp_post_types[\'post\']->labels;
$labels->name = \'Blog\';
$labels->singular_name = \'Blog\';
$labels->add_new = \'Add Blog entry\';
$labels->add_new_item = \'Add Blog entry\';
$labels->edit_item = \'Edit Blog entry\';
$labels->new_item = \'Blog entry\';
$labels->view_item = \'View Blog entry\';
$labels->search_items = \'Search Blog Entries\';
$labels->not_found = \'No Blog entries found\';
$labels->not_found_in_trash = \'No Blog entries found in Trash\';
$labels->all_items = \'All Blog Entries\';
$labels->menu_name = \'Blog\';
$labels->name_admin_bar = \'Blog\';
查看法典,我没有看到
wp_post_types
.
https://codex.wordpress.org/Function_Reference/get_post_type_object要解决此错误,接下来应该做什么?
谢谢詹姆斯