CPT notificacions
if ( ! function_exists('notificacions_post_type') ) {
// Register Custom Post Type
function notificacions_post_type() {
$labels = array(
'name' => _x( 'Notificacions', 'Post Type General Name', 'notificacions_domain' ),
'singular_name' => _x( 'Notificació', 'Post Type Singular Name', 'notificacions_domain' ),
'menu_name' => __( 'Notificacions', 'notificacions_domain' ),
'name_admin_bar' => __( 'Notificacions', 'notificacions_domain' ),
'archives' => __( 'Arxius de notificacions', 'notificacions_domain' ),
'attributes' => __( 'Atributs de notificacions', 'notificacions_domain' ),
'parent_item_colon' => __( 'Pare de notificació', 'notificacions_domain' ),
'all_items' => __( 'Totes les notificacions', 'notificacions_domain' ),
'add_new_item' => __( 'Agregar nova notificació', 'notificacions_domain' ),
'add_new' => __( 'Agregar nova', 'notificacions_domain' ),
'new_item' => __( 'Nova notificació', 'notificacions_domain' ),
'edit_item' => __( 'Editar notificació', 'notificacions_domain' ),
'update_item' => __( 'Actualitzar notificació', 'notificacions_domain' ),
'view_item' => __( 'Vore notificació', 'notificacions_domain' ),
'view_items' => __( 'Vore notificacions', 'notificacions_domain' ),
'search_items' => __( 'Buscar notificació', 'notificacions_domain' ),
'not_found' => __( 'No trobada', 'notificacions_domain' ),
'not_found_in_trash' => __( 'No trobada en papelera', 'notificacions_domain' ),
'featured_image' => __( 'Imatge destacada', 'notificacions_domain' ),
'set_featured_image' => __( 'Establir imatge destacada', 'notificacions_domain' ),
'remove_featured_image' => __( 'Borrar imatge destacada', 'notificacions_domain' ),
'use_featured_image' => __( 'Usar com a imatge destacada', 'notificacions_domain' ),
'insert_into_item' => __( 'Insertar en la notificació', 'notificacions_domain' ),
'uploaded_to_this_item' => __( 'Putjar a la notificació', 'notificacions_domain' ),
'items_list' => __( 'Llista de notificacions', 'notificacions_domain' ),
'items_list_navigation' => __( 'Navegació a la llista de notificacions', 'notificacions_domain' ),
'filter_items_list' => __( 'Llista d'elements de filtre', 'notificacions_domain' ),
);
$rewrite = array(
'slug' => 'notificacions',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Notificació', 'notificacions_domain' ),
'description' => __( 'Notificacions per als regs', 'notificacions_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'taxonomies' => array( 'regs', 'rius' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'notificacions', $args );
}
add_action( 'init', 'notificacions_post_type', 0 );
}