Created
February 17, 2013 19:59
-
-
Save AndreaBarghigiani/4973111 to your computer and use it in GitHub Desktop.
Crea un nuovo Custom Post Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Creazione Custom Post Type Portfolio | |
add_action( 'admin_init', 'wpam_portfolio' ); | |
function wpam_portfolio(){ | |
$labels = array( | |
'name' => _x('Portfolio', 'la sezione per i nostri lavori', 'tuo-tema'), | |
'singular_name' => _x('Lavoro', 'un elemento del nostro portfolio', 'tuo-tema'), | |
'add_new' => _x('Aggiungi Nuovo', 'elemento', 'tuo-tema'), | |
'add_new_item' => __('Aggiungi un Nuovo Lavoro', 'tuo-tema'), | |
'edit_item' => __('Modifica Lavoro', 'tuo-tema'), | |
'new_item' => __('Nuovo Lavoro', 'tuo-tema'), | |
'all_items' => __('Tutti i Lavori', 'tuo-tema'), | |
'view_item' => __('Visualizza Lavoro', 'tuo-tema'), | |
'search_items' => __('Ricerca Lavori', 'tuo-tema'), | |
'not_found' => __('Nessun lavoro trovato', 'tuo-tema'), | |
'not_found_in_trash' => __('Non ci sono lavori nel cestino', 'tuo-tema'), | |
'parent_item_colon' => '', | |
'menu_name' => 'Portfolio' | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'query_var' => true, | |
'rewrite' => true, | |
'capability_type' => 'post', | |
'has_archive' => true, | |
'hierarchical' => false, | |
'menu_position' => null, | |
'supports' => array( 'title', 'editor', 'thumbnail' ) | |
); | |
register_post_type( 'portfolio', $args ); | |
}// Fine wpam_portfolio | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment