get_col( $wpdb->prepare( " SELECT pm.meta_value FROM {$wpdb->postmeta} pm LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id WHERE pm.meta_key = '%s' AND p.post_status = '%s' AND p.post_type = '%s' ", $key, $status, $type ) ); return $r; } /* =========== Settings Menu ============ */ add_action('admin_menu', 'avcp_setting_menu'); add_action('admin_init', 'avcp_reg_settings'); if ( is_admin() ){ // admin actions } else { // non-admin enqueues, actions, and filters } function avcp_reg_settings() { register_setting( 'avcp_options', 'avcp_version_number'); update_option( 'avcp_version_number', '3.0' ); register_setting( 'avcp_options', 'avcp_denominazione_ente'); register_setting( 'avcp_options', 'avcp_codicefiscale_ente'); register_setting( 'avcp_options', 'avcp_autopublish'); register_setting( 'avcp_options', 'avcp_dis_archivioditte'); register_setting( 'avcp_options', 'avcp_dis_archivioanni'); register_setting( 'avcp_options', 'avcp_tab_jqueryui'); register_setting( 'avcp_options', 'avcp_showxml'); register_setting( 'avcp_options', 'avcp_showlove'); register_setting( 'avcp_options', 'avcp_invalid'); register_setting( 'avcp_options', 'avcp_abilita_ruoli'); } function avcp_setting_menu() { add_submenu_page('edit.php?post_type=avcp', 'Impostazioni', 'Impostazioni', 'manage_options', 'avcp_settings', 'avcp_settings_menu'); } function avcp_settings_menu() { if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } if(isset($_POST['XMLgenBUTTON'])) { $terms = get_terms( 'annirif', array('hide_empty' => 0) ); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { creafilexml ($term->name); $verificafilecreati = $term->name . ' - ' . $verificafilecreati; echo '
'; printf(__('AVCP | Il seguente file .xml è generato: ' . $term->name . '')); echo "
';
printf(__('AVCP | Impossibile creare il file .xml!
Controlla che sia presente qualche gara e che siano collegate al proprio "Anno di Riferimento"...'));
echo "