2014-11-03 1 views

답변

4

WooCommerce의 woocommerce_register_post_type_product이 모든 매개 변수를 수정하게됩니다 이러한 묘사 것입니다 경우

당신이 날 adivse 수있는 '제품'으로 그들을 볼 게시물 유형을 등록하는 데 사용됩니다.

다음 코드 (플러그인이어야 함)는 모든 백엔드 레이블을 변경해야합니다. 이 URL은 wp-admin/edit.php?post_type=product URL을 변경하지 않지만 제품 유형의 ID를 변경해야합니다. 그런 다음 WooCommerce가 전혀 작동하지 않을지 의심 스럽습니다.

프런트 엔드 퍼 뮤 링크는 퍼머 링크를 통해 설정되고 "쇼핑 페이지"설정을 통해 처리되지만이 필터를 통해서도 일 수 있습니다.

add_filter('woocommerce_register_post_type_product', 'so_26712459_post_type'); 

function so_26712459_post_type($args){ 
    $labels = array(
     'name'    => __('Tours', 'your-custom-plugin'), 
     'singular_name'  => __('Tour', 'your-custom-plugin'), 
     'menu_name'   => _x('Tours', 'Admin menu name', 'your-custom-plugin'), 
     'add_new'   => __('Add Tour', 'your-custom-plugin'), 
     'add_new_item'  => __('Add New Tour', 'your-custom-plugin'), 
     'edit'    => __('Edit', 'your-custom-plugin'), 
     'edit_item'   => __('Edit Tour', 'your-custom-plugin'), 
     'new_item'   => __('New Tour', 'your-custom-plugin'), 
     'view'    => __('View Tour', 'your-custom-plugin'), 
     'view_item'   => __('View Tour', 'your-custom-plugin'), 
     'search_items'  => __('Search Tours', 'your-custom-plugin'), 
     'not_found'   => __('No Tours found', 'your-custom-plugin'), 
     'not_found_in_trash' => __('No Tours found in trash', 'your-custom-plugin'), 
     'parent'    => __('Parent Tour', 'your-custom-plugin') 
    ); 

    $args['labels'] = $labels; 
    $args['description'] = __('This is where you can add new tours to your store.', 'your-custom-plugin'),'] 
    return $args; 
} 
관련 문제