Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

publications

if ( ! function_exists('publi_post_type') ) {

// Register Custom Post Type
function publi_post_type() {

	$labels = array(
		'name'                  => _x( 'Publications', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Publication', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Publications', 'text_domain' ),
		'name_admin_bar'        => __( 'Publication', 'text_domain' ),
		'archives'              => __( 'Publication Archives', 'text_domain' ),
		'attributes'            => __( 'Publication Attributes', 'text_domain' ),
		'parent_item_colon'     => __( 'Parent de Publication:', 'text_domain' ),
		'all_items'             => __( 'Toutes les Publications', 'text_domain' ),
		'add_new_item'          => __( 'Ajouter une Publication', 'text_domain' ),
		'add_new'               => __( 'Ajouter Publication', 'text_domain' ),
		'new_item'              => __( 'Nouvelle Publication', 'text_domain' ),
		'edit_item'             => __( 'Editer la Publication', 'text_domain' ),
		'update_item'           => __( 'Mettre à jour la Publication', 'text_domain' ),
		'view_item'             => __( 'Voir la Publication', 'text_domain' ),
		'view_items'            => __( 'Voir les Publications', 'text_domain' ),
		'search_items'          => __( 'Chercher une Publication', 'text_domain' ),
		'not_found'             => __( 'Aucune Publication trouvée', 'text_domain' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'text_domain' ),
		'featured_image'        => __( 'Featured Image', 'text_domain' ),
		'set_featured_image'    => __( 'Attacher une image de couverture', 'text_domain' ),
		'remove_featured_image' => __( 'Retirer l'image', 'text_domain' ),
		'use_featured_image'    => __( 'Utiliser comme image de couverture', 'text_domain' ),
		'insert_into_item'      => __( 'Inserer dans la Publication', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Uploadé dans cette Publication', 'text_domain' ),
		'items_list'            => __( 'Liste des Publications', 'text_domain' ),
		'items_list_navigation' => __( 'liste navigation Publications', 'text_domain' ),
		'filter_items_list'     => __( 'Filtrer la liste des Publications', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Publication', 'text_domain' ),
		'description'           => __( 'articles pour les utilisateurs de LaUne.bzh', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'post-formats' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-embed-photo',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'post',
		'show_in_rest'          => true,
	);
	register_post_type( 'publication', $args );

}
add_action( 'init', 'publi_post_type', 0 );

}