http://wordpress.org/support/topic/error-when-searching-for-posts-in-the-backend-illegel-offset
这些提到了一些不同的潜在原因,例如https://core.trac.wordpress.org/ticket/12704 - 但现在已经解决了(我运行的是v3.1.3),其中最后一篇文章写道:基本上,你有一个插件错误地注册了一个帖子类型,然后核心抱怨。据我所知,这不是核心缺陷。
我确实有一个插件(我自己的)注册了一个帖子类型,但我认为它做得很正确。
这是代码。(请注意,我最初称这些“视频”帖子,但后来将前端描述重命名为“Training Module”,但保留了原来的帖子类型名称)。
function video_register() {
$labels = array(
\'name\' => _x(\'Modules\', \'post type general name\'),
\'singular_name\' => _x(\'Training Module\', \'post type singular name\'),
\'add_new\' => _x(\'Add New Module\', \'video item\'),
\'add_new_item\' => __(\'Add New Training Module\'),
\'edit_item\' => __(\'Edit Training Module\'),
\'new_item\' => __(\'New Training Module\'),
\'view_item\' => __(\'View Training Module\'),
\'search_items\' => __(\'Search Training Modules\'),
\'not_found\' => __(\'No Training Modules found\'),
\'not_found_in_trash\' => __(\'No Training Modules found in Trash\'),
\'parent_item_colon\' => \'\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => true,
\'has_archive\' => \'video\',
\'menu_icon\' => \'video16x16.png\',
\'rewrite\' => array(\'slug\'=>\'training\',\'with_front\'=>false),
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => \'15\',
\'supports\' => array(\'title\',\'author\',\'editor\',\'custom-fields\',\'revisions\',\'comments\',\'trackbacks\'),
\'taxonomies\' => array(\'category\', \'post_tag\')
);
register_post_type( \'video\' , $args );
}
add_action(\'init\', \'video_register\');
有什么问题吗?为什么我会看到警告?