我不知道我可以为超过1个CPT/post类型注册分类法!
register_taxonomy( \'location\', array( \'offer\', \'store\' ), array(
\'label\' => __( \'Location\', \'themeify\' ),
\'hierarchical\' => true,
\'labels\' => array(
\'name\' => __( \'Location\', \'themeify\' ),
\'singular_name\' => __( \'Location\', \'themeify\' ),
\'menu_name\' => __( \'Location\', \'themeify\' ),
\'all_items\' => __( \'All Locations\', \'themeify\' ),
\'edit_item\' => __( \'Edit Location\', \'themeify\' ),
\'view_item\' => __( \'View Location\', \'themeify\' ),
\'update_item\' => __( \'Update Location\', \'themeify\' ),
\'add_new_item\' => __( \'Add New Location\', \'themeify\' ),
\'new_item_name\' => __( \'New Location Name\', \'themeify\' ),
\'parent_item\' => __( \'Parent Location\', \'themeify\' ),
\'parent_item_colon\' => __( \'Parent Location:\', \'themeify\' ),
\'search_items\' => __( \'Search Locations\', \'themeify\' ),
\'popular_items\' => __( \'Popular Locations\', \'themeify\' ),
\'separate_items_with_commas\' => __( \'Separate locations with commas\', \'themeify\' ),
\'add_or_remove_items\' => __( \'Add or remove locations\', \'themeify\' ),
\'choose_from_most_used\' => __( \'Choose from the most used locations\', \'themeify\' ),
\'not_found\' => __( \'No locations found\', \'themeify\' ),
)
) );
我添加了带有自定义post类型“offer”和“store”的数组。
现在,当我向这个分类法中添加位置时,它在提供和存储中都会更新:)没有位置重复:D