Form
if ( ! function_exists('custom_post_type_formnidil') ) {
// Register Custom Post Type
function custom_post_type_formnidil() {
$labels = array(
'name' => _x( 'Forms', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Form', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Post Type', 'text_domain' ),
'parent_item_colon' => __( 'Form padre:', 'text_domain' ),
'all_items' => __( 'Tutti le forms', 'text_domain' ),
'view_item' => __( 'Vedi form', 'text_domain' ),
'add_new_item' => __( 'Aggiungi form', 'text_domain' ),
'add_new' => __( 'Aggiungi', 'text_domain' ),
'edit_item' => __( 'Modifica form', 'text_domain' ),
'update_item' => __( 'Aggiorna form', 'text_domain' ),
'search_items' => __( 'Cerca form', 'text_domain' ),
'not_found' => __( 'Non trovata', 'text_domain' ),
'not_found_in_trash' => __( 'Non trovata nel cestino', 'text_domain' ),
);
$rewrite = array(
'slug' => 'post_type',
'with_front' => true,
'pages' => false,
'feeds' => false,
);
$args = array(
'label' => __( 'post_type', 'text_domain' ),
'description' => __( 'Nuova form di contatto', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => false,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'post_type', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type_formnidil', 0 );
}