我正在注册自定义帖子类型,如:
/* POST TYPE: SECRET CARDS */
function register_post_type_secret_cards()
{
$args = array(
\'labels\' => array(
\'name\' => \'Secret Cards\',
\'singular_name\' => \'Secret Card\',
\'add_new\' => \'Add New Item\',
\'add_new_item\' => \'Add New Item\',
\'edit_item\' => \'Edit Item\',
\'new_item\' => \'Add New Item\',
\'view_item\' => \'View Items\',
\'search_items\' => \'Search Items\',
\'not_found\' => \'No Item Found\',
\'not_found_in_trash\' => \'No Items Found in Trash\'
),
\'query_var\' => \'secret_cards\',
\'rewrite\' => array(
\'slug\' => \'secret-cards/\',
),
\'public\' => true,
\'menu_position\' => 4,
\'supports\' => array(
\'title\',
)
);
register_post_type(\'secret_cards\', $args);
}
add_action( \'init\', \'register_post_type_secret_cards\' );
这些卡可以从前端访问,如:
http://myweb.com/secret-cards/john-wayne
但我不想让人们从前端访问这些IK。它应该只能在admin中访问。
如何做到这一点?