在进一步搜索后找到此代码段:
//Force posts of custom type to be private
//…but first make sure they are not \'trash\' otherwise it is impossible to trash a post
function force_type_private($post)
{
if (($post[\'post_type\'] == \'post\')
{
if ($post[\'post_status\'] != \'trash\') $post[\'post_status\'] = \'private\';
}
return $post;
}
add_filter(\'wp_insert_post_data\', \'force_type_private\');
将布尔值更改为:
if (($post[\'post_type\'] == \'post\')&&(!current_user_can(\'administrator\')))
这确保只有管理员可以发布。