_x( 'Spese', 'spesa' ), 'singular_name' => _x( 'Spesa', 'spesa' ), 'add_new' => _x( 'Nuova Spesa', 'spesa' ), 'add_new_item' => _x( 'Nuova Spesa', 'spesa' ), 'edit_item' => _x( 'Modifica Spesa', 'spesa' ), 'new_item' => _x( 'Nuova Spesa', 'spesa' ), 'view_item' => _x( 'Visualizza Spesa', 'spesa' ), 'search_items' => _x( 'Cerca Spesa', 'spesa' ), 'not_found' => _x( 'Nessun elemento trovato', 'spesa' ), 'not_found_in_trash' => _x( 'Nessun elemento trovato', 'spesa' ), 'parent_item_colon' => _x( 'Parent Spesa:', 'spesa' ), 'menu_name' => _x( 'Lista Spese', 'spesa' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'description' => 'In particolare, al fine di ottemperare all’obbligo normativo, per ogni spesa documentata è richiesta la pubblicazione di informazioni relative a: ragione sociale e dati fiscali dell’impresa beneficiaria; importo di spesa; la norma o il titolo a base dell’attribuzione; l’ufficio e il funzionario o responsabile del procedimento amministrativo; metodo e modalità per la scelta del beneficiario; link utili a: progetto selezionato, curriculum del soggetto incaricato, contratto e capitolato della prestazione, fornitura o servizio', 'supports' => array( 'title', 'custom-fields' ), 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => site_url(). '/wp-content/plugins/AmministrazioneAperta/openshareicon-16x16.png', 'show_in_nav_menus' => false, 'publicly_queryable' => true, 'exclude_from_search' => true, 'has_archive' => false, 'query_var' => false, 'can_export' => true, 'rewrite' => true, 'capability_type' => 'post' ); register_post_type( 'spesa', $args ); } /* =========== TITOLO HCK =========== */ function change_default_title( $title ){ $screen = get_current_screen(); if ( 'spesa' == $screen->post_type ) { $title = 'Inserire Titolo Spesa/Progetto'; } return $title; } add_filter( 'enter_title_here', 'change_default_title' ); /* =========== SHORTCODE ============ */ function ammap_func( $atts ){ include (ABSPATH. '/wp-content/plugins/AmministrazioneAperta/tablegen.php'); } add_shortcode( 'ammap', 'ammap_func' ); /* =========== META BOX ============ */ include (ABSPATH. '/wp-content/plugins/AmministrazioneAperta/meta-box-class/my-meta-box-class.php'); /* * configure your meta box */ $config = array( 'id' => 'ammap_meta_box', // meta box id, unique per meta box 'title' => 'Dettagli Spesa', // meta box title 'pages' => array('spesa'), // post types, accept custom post types as well, default is array('post'); optional 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional 'priority' => 'high', // order of meta box: high (default), low; optional 'fields' => array(), // list of meta fields (can be added by field arrays) or using the class's functions 'local_images' => false, // Use local or hosted images (meta box images for add/remove) 'use_with_theme' => false //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). ); /* * Initiate your meta box */ $my_meta = new AT_Meta_Box($config); /* * Campi personalizzati del Plugin - Usa API terze parti */ $prefix = "ammap_"; //text field $my_meta->addText($prefix.'beneficiario',array('name'=> 'Beneficiario')); $my_meta->addText($prefix.'importo',array('name'=> 'Importo. Es. 2.000')); $my_meta->addText($prefix.'fiscale',array('name'=> 'Dati Fiscali')); $my_meta->addText($prefix.'norma',array('name'=> 'Norma')); $my_meta->addText($prefix.'responsabile',array('name'=> 'Responsabile')); $my_meta->addText($prefix.'determina',array('name'=> 'Determina')); //select field $my_meta->addSelect($prefix.'assegnazione',array('Chiamata Diretta'=>'Chiamata Diretta','Bando Pubblico'=>'Bando Pubblico'),array('name'=> 'Modalità Assegnazione', 'std'=> array('Selezionare...'))); //date field $my_meta->addDate($prefix.'data',array('name'=> 'Data')); /* * Don't Forget to Close up the meta box deceleration */ //Finish Meta Box Deceleration $my_meta->Finish(); /* =========== Credits Menu ============ */ function ammap_menu(){ add_submenu_page( 'edit.php?post_type=spesa', 'Credits', 'Credits', 'manage_options', 'ammap_credits', 'ammap_settings_menu' ); } add_action( 'admin_menu', 'ammap_menu' ); function ammap_settings_menu(){ echo '