Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

votes_senat_erickerrouche

if ( ! function_exists('votes_senat') ) {

// Register Custom Post Type
function votes_senat() {

	$labels = array(
		'name'                  => _x( 'Votes au Sénat', 'Post Type General Name', 'erickerrouche' ),
		'singular_name'         => _x( 'Vote au Sénat', 'Post Type Singular Name', 'erickerrouche' ),
		'menu_name'             => __( 'Votes au Sénat', 'erickerrouche' ),
		'name_admin_bar'        => __( 'Votes au Sénat', 'erickerrouche' ),
		'archives'              => __( 'Archives Votes au Sénat', 'erickerrouche' ),
		'attributes'            => __( 'Attributs Votes au Sénat', 'erickerrouche' ),
		'parent_item_colon'     => __( 'Parent Votes au Sénat', 'erickerrouche' ),
		'all_items'             => __( 'Tous les Votes au Sénat', 'erickerrouche' ),
		'add_new_item'          => __( 'Ajouter 1 vote', 'erickerrouche' ),
		'add_new'               => __( 'Ajouter 1 nouveau vote', 'erickerrouche' ),
		'new_item'              => __( 'Nouveau vote', 'erickerrouche' ),
		'edit_item'             => __( 'Editer vote', 'erickerrouche' ),
		'update_item'           => __( 'Mettre à jour le vote', 'erickerrouche' ),
		'view_item'             => __( 'Voir le vote', 'erickerrouche' ),
		'view_items'            => __( 'Voir les votes', 'erickerrouche' ),
		'search_items'          => __( 'Recherchez un vote', 'erickerrouche' ),
		'not_found'             => __( 'Vote non trouvé', 'erickerrouche' ),
		'not_found_in_trash'    => __( 'Vote non trouvé dans la corbeille', 'erickerrouche' ),
		'featured_image'        => __( 'Image Vote', 'erickerrouche' ),
		'set_featured_image'    => __( 'Set featured image Vote', 'erickerrouche' ),
		'remove_featured_image' => __( 'Remove featured image Vote', 'erickerrouche' ),
		'use_featured_image'    => __( 'Use as featured image Vote', 'erickerrouche' ),
		'insert_into_item'      => __( 'Insert into Vote', 'erickerrouche' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Vote', 'erickerrouche' ),
		'items_list'            => __( 'Votes list', 'erickerrouche' ),
		'items_list_navigation' => __( 'Votes list navigation', 'erickerrouche' ),
		'filter_items_list'     => __( 'Filter Vote list', 'erickerrouche' ),
	);
	$rewrite = array(
		'slug'                  => 'votes',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Vote au Sénat', 'erickerrouche' ),
		'description'           => __( 'Votes au Sénat', 'erickerrouche' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'custom-fields' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-tickets-alt',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'query_var'             => 'post_type',
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
	);
	register_post_type( 'votes_senat_type', $args );

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

}