Created
November 7, 2011 15:55
-
-
Save fael/1345338 to your computer and use it in GitHub Desktop.
Exemplo de uso de Custom Types do WordPress
This file contains hidden or 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
//gerado pelo http://themergency.com/generators/cpt-code-output/?id=8966 | |
add_action( 'init', 'register_cpt_atividade' ); | |
function register_cpt_atividade() { | |
$labels = array( | |
'name' => _x( 'Atividades', 'atividade' ), | |
'singular_name' => _x( 'Atividade', 'atividade' ), | |
'add_new' => _x( 'Adicionar Atividade', 'atividade' ), | |
'add_new_item' => _x( 'Cadastrar uma Atividade', 'atividade' ), | |
'edit_item' => _x( 'Editar Atividade', 'atividade' ), | |
'new_item' => _x( 'Nova Atividade', 'atividade' ), | |
'view_item' => _x( 'Detalhes da Atividade', 'atividade' ), | |
'search_items' => _x( 'Pesquisar Atividades', 'atividade' ), | |
'not_found' => _x( 'Nenhuma Atividade Cadastrada', 'atividade' ), | |
'not_found_in_trash' => _x( 'Nenhuma Atividade existente no lixo', 'atividade' ), | |
'parent_item_colon' => _x( 'Parent Atividade:', 'atividade' ), | |
'menu_name' => _x( 'Atividades', 'atividade' ), | |
); | |
$args = array( | |
'labels' => $labels, | |
'hierarchical' => false, | |
'description' => 'asdasd', | |
'supports' => array( 'title', 'editor', 'custom-fields' ), | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'publicly_queryable' => true, | |
'exclude_from_search' => false, | |
'has_archive' => true, | |
'query_var' => true, | |
'can_export' => true, | |
'rewrite' => true, | |
'capability_type' => 'post' | |
); | |
register_post_type( 'atividade', $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment