Ответы в темах

Просмотр 1 ответа (всего 1)
  • формируется как я понял так:
    // Recipe post type
    add_action( ‘init’, ‘osetin_create_recipe_post_type’ );
    function osetin_create_recipe_post_type() {
    $recipe_slug_default = __(‘recipe’, ‘osetin-helper’);
    if(function_exists(‘osetin_get_field’)){
    $recipe_slug = osetin_get_field(‘recipe_slug’, ‘option’, $recipe_slug_default);
    }else{
    $recipe_slug = $recipe_slug_default;
    }
    register_post_type( ‘osetin_recipe’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Рецепты’, ‘osetin-helper’ ),
    ‘singular_name’ => __( ‘Рецепт’, ‘osetin-helper’ ),
    ‘add_new’ => __(‘Добавить рецепт’, ‘osetin-helper’),
    ‘add_new_item’ => __(‘Добавить новый рецепт’, ‘osetin-helper’),
    ‘edit_item’ => __(‘Изменить рецепт’, ‘osetin-helper’),
    ‘new_item’ => __(‘Новый рецепт’, ‘osetin-helper’),
    ‘view_item’ => __(‘Посмотреть рецепт’, ‘osetin-helper’),
    ‘search_items’ => __(‘Найти рецепт’, ‘osetin-helper’),
    ‘not_found’ => __(‘Рецепт не найдет’, ‘osetin-helper’),
    ),
    ‘rewrite’ => array( ‘slug’ => $recipe_slug ),
    ‘taxonomies’ => array(‘category’, ‘post_tag’),
    ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’, ‘post-formats’ ),
    ‘menu_position’ => 5,
    ‘public’ => true,
    ‘has_archive’ => true,
    )
    );

Просмотр 1 ответа (всего 1)