Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Type de contenu Livre
- $book = register_cuztom_post_type(
- 'Livre',
- array(
- 'menu_icon' => get_template_directory_uri() . '/img/book.png'
- )
- );
- $book->add_taxonomy('Genre');
- // Ajouter une metabox et plusieurs champs
- $book->add_meta_box(
- 'book_info',
- 'Information sur ce livre',
- array(
- array(
- 'name' => 'publication_date',
- 'label' => 'Date de publication',
- 'type' => 'date',
- 'description' => 'Description qui va sous le titre',
- 'explanation' => 'Explication qui va sous le champs',
- ),
- array(
- 'name' => 'cover',
- 'label' => 'Couverture du livre',
- 'type' => 'image',
- 'description' => 'Envoyez une image de couverture du livre'
- ),
- array(
- 'type' => 'post_select',
- 'name' => 'author',
- 'label' => 'Auteur du livre',
- 'args' => array(
- 'post_type' => 'author',
- 'posts_per_page' => -1
- )
- )
- )
- );
- // Type de contenu Auteur
- $author = register_cuztom_post_type(
- 'Auteur',
- array(
- 'menu_icon' => get_template_directory_uri() . '/img/pencil.png'
- )
- );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement