毫无疑问,我错过了一些明显的东西。。。
以下将正文类添加到管理页的代码将生成此错误通知:
Notice: Trying to get property of non-object in /.../box.php on line 103
public function admin_body_class($classes) {
global $wpdb, $post;
$screen = get_current_screen();
/* Line 103 */ if ($post->post_parent > 0 ) {
$status = \'child-\';
} else {
$status = \'parent-\';
}
$classes .= \' \' . $status . $screen->post_type;
return $classes;
}