Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Este commit insere um Custom Post Type Clientes. #91

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,4 @@ function horizon_theme_enqueue_scripts() {
*/
require_once get_template_directory() . '/inc/customizer/customizer.php';



require_once get_template_directory() . '/inc/cpts/cpt-clientes.php';
55 changes: 55 additions & 0 deletions inc/cpts/cpt-clientes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

#Custom Post Type - Clientes

add_action( 'init', 'register_cpt_clientes' );

function register_cpt_clientes() {

$labels = array(
'name' => __('Clientes','horizon-theme'),
'singular_name' => __( 'Cliente','horizon-theme'),
'add_new' => __('Adicionar Cliente','horizon-theme'),
'add_new_item' => __( 'Adicionar novo Cliente','horizon-theme'),
'edit_item' => __( 'Editar Cliente','horizon-theme'),
'new_item' => __( 'Novo Cliente','horizon-theme'),
'view_item' => __( 'Ver Cliente','horizon-theme'),
'search_items' => __( 'Pesquisar Clientes','horizon-theme'),
'not_found' => __( 'Não encontrado','horizon-theme'),
'not_found_in_trash' => __( 'Não encontrado na Lixeira','horizon-theme'),
'parent_item_colon' => __( 'Clientes','horizon-theme'),
'menu_name' => __( 'Clientes','horizon-theme'),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'description' => 'Custom Post Type Clientes',
'supports' => array(
'title',
'thumbnail',
'editor',
'author',
'excerpt',
'trackbacks',
'custom-fields',
'comments',
'revisions',
'page-atributes',
'post-formats'
),
'taxonomies' => array('category', 'post_tag'),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'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( 'clientes', $args );
}