我定义了自定义postype:property,如下所示
function register_cpt_property() {
$labels = array(
\'name\' => _x( \'properties\', \'property\' ),
\'singular_name\' => _x( \'property\', \'property\' ),
\'add_new\' => _x( \'Add New\', \'property\' ),
\'add_new_item\' => _x( \'Add New property\', \'property\' ),
\'edit_item\' => _x( \'Edit property\', \'property\' ),
\'new_item\' => _x( \'New property\', \'property\' ),
\'view_item\' => _x( \'View property\', \'property\' ),
\'search_items\' => _x( \'Search properties\', \'property\' ),
\'not_found\' => _x( \'No properties found\', \'property\' ),
\'not_found_in_trash\' => _x( \'No properties found in Trash\', \'property\' ),
\'parent_item_colon\' => _x( \'Parent property:\', \'property\' ),
\'menu_name\' => _x( \'properties\', \'property\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => false,
\'supports\' => array( \'title\', \'editor\', \'excerpt\', \'author\', \'thumbnail\', \'custom-fields\' ),
\'taxonomies\' => array( \'category\', \'zone\', \'rent\' ),
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'show_in_nav_menus\' => true,
\'publicly_queryable\' => true,
\'exclude_from_search\' => false,
\'has_archive\' => true,
\'query_var\' => true,
\'can_export\' => true,
\'rewrite\' => true,
\'capability_type\' => \'post\'
);
register_post_type( \'property\', $args );
}
问题是,这将生成此模块:
Wich要求用户使用Wich自定义字段,Wich很棒;但是,有没有办法设置默认组?这个模块最初是这样的?
(我想这样做,这样用户就不会忘记其中的任何一个……但如果他想添加更多,也没关系)
有没有办法做到这一点?