Deligraph-V3/includes/post-types.php
2024-09-24 15:38:08 +02:00

40 lines
1.0 KiB
PHP

<?php
function cpt_customer()
{
register_post_type(
'customer',
array(
'label' => __('Customers'),
'singular_label' => __('Customer'),
'public' => true,
'show_ui' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array("slug" => "customers"),
'query_var' => "customers",
'supports' => array('title', 'editor', 'thumbnail') //titre + zone de texte + champs personnalisés + miniature valeur possible : 'title','editor','author','thumbnail','excerpt'
)
);
register_taxonomy_for_object_type('post_tag', 'customer', 'show_tagcloud=1&hierarchical=true');
register_post_type(
'portfolio',
array(
'label' => __('Portfolio'),
'singular_label' => __('Portfolio'),
'public' => true,
'menu_icon' => 'dashicons-forms',
'show_ui' => true,
'hierarchical' => false,
'supports' => array('title', 'thumbnail')
)
);
}
add_action('init', 'cpt_customer');