2013-08-05 5 views
0

Locations라는 사용자 지정 분류 체계를 만들었지 만 모든 것이 잘 작동하지만 taxonomy를 추가 할 때마다 분류 체계 이름이 범주가 아닌 위치, Like Add New category 등과 같이 wp-admin에서 표시됩니다.Wordpress 사용자 정의 분류 표시 이름 문제

function reg_location_taxonomy() { 
    register_taxonomy('location', array('product'), array('hierarchical' => true, 'label' => 'Locations', 'singular_label' => 'Location', 'rewrite' => true)); 
    // register_taxonomy_for_object_type('location', 'product'); 
} 
add_action('init', 'reg_location_taxonomy', 0); 

답변

2

당신은 배열을

function reg_location_taxonomy() { 
    register_taxonomy('location', array('product'), array('hierarchical' => true, 'label' => $labels, 'singular_label' => 'Location', 'rewrite' => true)); 
    // register_taxonomy_for_object_type('location', 'product'); 
} 
add_action('init', 'reg_location_taxonomy', 0); 
을 다음과 같은

$labels = array(
    'name'    => _x('Locations', 'taxonomy general name'), 
    'singular_name'  => _x('Location', 'taxonomy singular name'), 
    'search_items'  => __('Search Locations'), 
    'all_items'   => __('All Locations'), 
    'parent_item'  => __('Parent Location'), 
    'parent_item_colon' => __('Parent Location:'), 
    'edit_item'   => __('Edit Location'), 
    'update_item'  => __('Update Location'), 
    'add_new_item'  => __('Add New Location'), 
    'new_item_name'  => __('New Location Name'), 
    'menu_name'   => __('Location'), 
); 

다음에 라벨 vaue를 추가 필요3210

관련 문제