Max – Post Type – Script
if ( ! function_exists('cntv_script_post_type') ) {
// Register Custom Post Type
function cntv_script_post_type() {
$labels = array(
'name' => _x( 'Scripts', 'Post Type General Name', 'centivemax' ),
'singular_name' => _x( 'Script', 'Post Type Singular Name', 'centivemax' ),
'menu_name' => __( 'Centive · Script e Tags', 'centivemax' ),
'name_admin_bar' => __( 'Centive · Script e Tags', 'centivemax' ),
'archives' => __( 'Arquivo de scripts', 'centivemax' ),
'attributes' => __( 'Atributos do script', 'centivemax' ),
'parent_item_colon' => __( 'Script principal:', 'centivemax' ),
'all_items' => __( 'Todos os scripts', 'centivemax' ),
'add_new_item' => __( 'Adicionar novo script', 'centivemax' ),
'add_new' => __( 'Adicionar novo', 'centivemax' ),
'new_item' => __( 'Novo script', 'centivemax' ),
'edit_item' => __( 'Editar script', 'centivemax' ),
'update_item' => __( 'Atualizar script', 'centivemax' ),
'view_item' => __( 'Ver script', 'centivemax' ),
'view_items' => __( 'Ver script', 'centivemax' ),
'search_items' => __( 'Buscar script', 'centivemax' ),
'not_found' => __( 'Nada encontrado', 'centivemax' ),
'not_found_in_trash' => __( 'Nada encontrado na Lixeira', 'centivemax' ),
'featured_image' => __( 'Imagem destacada', 'centivemax' ),
'set_featured_image' => __( 'Escolher imagem destacada', 'centivemax' ),
'remove_featured_image' => __( 'Remover imagem destacada', 'centivemax' ),
'use_featured_image' => __( 'Usar como imagem destacada', 'centivemax' ),
'insert_into_item' => __( 'Inserir no script', 'centivemax' ),
'uploaded_to_this_item' => __( 'Carregado para este script', 'centivemax' ),
'items_list' => __( 'Lista dos scripts', 'centivemax' ),
'items_list_navigation' => __( 'Navegação de lista dos scripts', 'centivemax' ),
'filter_items_list' => __( 'Filtrar lista de scripts', 'centivemax' ),
);
$capabilities = array(
'edit_post' => 'update_core',
'read_post' => 'update_core',
'delete_post' => 'update_core',
'edit_posts' => 'update_core',
'edit_others_posts' => 'update_core',
'publish_posts' => 'update_core',
'read_private_posts' => 'update_core',
);
$args = array(
'label' => __( 'Script', 'centivemax' ),
'description' => __( 'Crie Scripts personalizados', 'centivemax' ),
'labels' => $labels,
'supports' => array( 'title', 'editor' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 100,
'menu_icon' => 'dashicons-star-filled',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capabilities' => $capabilities,
'show_in_rest' => false,
);
register_post_type( 'cntv-script', $args );
}
add_action( 'init', 'cntv_script_post_type', 0 );
}