Post Type GL
// Register Custom Post Type
function gz_add_empreendimentos() {
$labels = array(
'name' => _x( 'Empreendimentos', 'Post Type General Name', 'gz_td' ),
'singular_name' => _x( 'Empreendimento', 'Post Type Singular Name', 'gz_td' ),
'menu_name' => __( 'Empreendimentos', 'gz_td' ),
'name_admin_bar' => __( 'Empreendimento', 'gz_td' ),
'archives' => __( 'Empreendimentos', 'gz_td' ),
'attributes' => __( 'Item Attributes', 'gz_td' ),
'parent_item_colon' => __( 'Empreendimento Parente', 'gz_td' ),
'all_items' => __( 'Todos os Empreendimentos', 'gz_td' ),
'add_new_item' => __( 'Adicionar novo Empreendimento', 'gz_td' ),
'add_new' => __( 'Adicionar Novo', 'gz_td' ),
'new_item' => __( 'Novo Empreendimento', 'gz_td' ),
'edit_item' => __( 'Editar Empreendimento', 'gz_td' ),
'update_item' => __( 'Atualizar Empreendimento', 'gz_td' ),
'view_item' => __( 'Ver Empreendimento', 'gz_td' ),
'view_items' => __( 'Ver Empreendimentos', 'gz_td' ),
'search_items' => __( 'Buscar Empreendimento', 'gz_td' ),
'not_found' => __( 'Não encontrado', 'gz_td' ),
'not_found_in_trash' => __( 'Não encontrado no lixo', 'gz_td' ),
'featured_image' => __( 'Imagem Destacada', 'gz_td' ),
'set_featured_image' => __( 'Escolher imagem destacada', 'gz_td' ),
'remove_featured_image' => __( 'Remover imagem destacada', 'gz_td' ),
'use_featured_image' => __( 'Usar como imagem destacada', 'gz_td' ),
'insert_into_item' => __( 'Inserir no Empreendimento', 'gz_td' ),
'uploaded_to_this_item' => __( 'Neste Empreendimento', 'gz_td' ),
'items_list' => __( 'Lista de Empreendimentos', 'gz_td' ),
'items_list_navigation' => __( 'Navegação de lista de Empreendimentos', 'gz_td' ),
'filter_items_list' => __( 'Filtrar lista de Empreendimentos', 'gz_td' ),
);
$rewrite = array(
'slug' => 'empreendimento',
'with_front' => false,
'pages' => true,
'feeds' => true,
);
$capabilities = array(
'edit_post' => 'gz_capacidades',
'read_post' => 'gz_capacidades',
'delete_post' => 'gz_capacidades',
'edit_posts' => 'gz_capacidades',
'edit_others_posts' => 'gz_capacidades',
'publish_posts' => 'gz_capacidades',
'read_private_posts' => 'gz_capacidades',
);
$args = array(
'label' => __( 'Empreendimento', 'gz_td' ),
'description' => __( 'Empreendimentos para o site Grupo Lar', 'gz_td' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
'taxonomies' => array( 'tipo_emp', ' status_emp', ' dorm_emp', ' cidade_emp' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 10,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'empreendimentos',
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capabilities' => $capabilities,
);
register_post_type( 'gz_empreendimento', $args );
}
add_action( 'init', 'gz_add_empreendimentos', 0 );