Created
December 19, 2022 14:47
-
-
Save thierrypigot/922547bc37f1309fe6a6deebc07c8262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create a new "Heures d'ouverture" taxonomy | |
function create_opening_hours_taxonomy() { | |
$labels = array( | |
'name' => _x( 'Heures d'ouverture', 'taxonomy general name', 'textdomain' ), | |
'singular_name' => _x( 'Heure d'ouverture', 'taxonomy singular name', 'textdomain' ), | |
'search_items' => __( 'Rechercher des heures d'ouverture', 'textdomain' ), | |
'all_items' => __( 'Toutes les heures d'ouverture', 'textdomain' ), | |
'parent_item' => __( 'Heure d'ouverture parente', 'textdomain' ), | |
'parent_item_colon' => __( 'Heure d'ouverture parente:', 'textdomain' ), | |
'edit_item' => __( 'Modifier l'heure d'ouverture', 'textdomain' ), | |
'update_item' => __( 'Mettre à jour l'heure d'ouverture', 'textdomain' ), | |
'add_new_item' => __( 'Ajouter une heure d'ouverture', 'textdomain' ), | |
'new_item_name' => __( 'Nouvelle heure d'ouverture', 'textdomain' ), | |
'menu_name' => __( 'Heures d'ouverture', 'textdomain' ), | |
); | |
$args = array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'opening-times' ), | |
); | |
register_taxonomy( 'opening_times', array( 'post' ), $args ); | |
} | |
add_action( 'init', 'create_opening_hours_taxonomy', 0 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment