array( 'name' => 'Spettacoli', 'singular_name' => 'Spettacolo', 'add_new_item' => 'Aggiungi spettacolo', 'edit_item' => 'Modifica spettacolo', ), 'public' => false, 'show_ui' => true, 'publicly_queryable' => false, 'exclude_from_search'=> true, 'show_in_rest' => false, 'menu_icon' => 'dashicons-tickets-alt', 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' ), 'has_archive' => false, 'rewrite' => false, ) ); register_post_type( 'azl_gallery', array( 'labels' => array( 'name' => 'Galleria', 'singular_name' => 'Foto', 'add_new_item' => 'Aggiungi foto', 'edit_item' => 'Modifica foto', ), 'public' => false, 'show_ui' => true, 'show_in_rest' => false, 'menu_icon' => 'dashicons-format-gallery', 'supports' => array( 'title', 'thumbnail', 'page-attributes' ), ) ); } add_action( 'init', 'azionelab_register_content_types' ); function azionelab_use_classic_editor_for_structured_content( bool $use_block_editor, string $post_type ): bool { if ( in_array( $post_type, array( 'azl_show', 'azl_gallery' ), true ) ) { return false; } return $use_block_editor; } add_filter( 'use_block_editor_for_post_type', 'azionelab_use_classic_editor_for_structured_content', 10, 2 ); function azionelab_add_meta_boxes(): void { add_meta_box( 'azl_show_details', 'Dettagli spettacolo', 'azionelab_show_meta_box', 'azl_show', 'normal' ); add_meta_box( 'azl_gallery_details', 'Dettagli foto', 'azionelab_gallery_meta_box', 'azl_gallery', 'normal' ); } add_action( 'add_meta_boxes', 'azionelab_add_meta_boxes' ); function azionelab_show_meta_box( WP_Post $post ): void { wp_nonce_field( 'azionelab_save_meta', 'azionelab_meta_nonce' ); $year = get_post_meta( $post->ID, 'azl_show_year', true ); $year = '0' === (string) $year ? '' : $year; $location = get_post_meta( $post->ID, 'azl_show_location', true ); ?>
Questo testo appare nella card dello spettacolo in homepage.