Created
June 25, 2021 17:55
-
-
Save shaunpalmer/fdb8633ae898fc17293537d6678eaa20 to your computer and use it in GitHub Desktop.
recommendations taxonomies
This file contains hidden or 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
| // Custom Taxonomies | |
| function SP_PS_register_recommendations_taxonomies() { | |
| // Type of recommendations taxonomy | |
| $labels = array( | |
| 'name' => 'Type of recommendations', | |
| 'singular_name' => 'Type of recommendations', | |
| 'search_items' => 'Search Types of recommendations', | |
| 'all_items' => 'All Types of recommendations', | |
| 'parent_item' => 'Parent Type of recommendations', | |
| 'parent_item_colon' => 'Parent Type of recommendations:', | |
| 'edit_item' => 'Edit Type of recommendations', | |
| 'update_item' => 'Update Type of recommendations', | |
| 'add_new_item' => 'Add New Type of recommendations', | |
| 'new_item_name' => 'New Type of recommendations Name', | |
| 'menu_name' => 'Type of recommendations', | |
| ); | |
| $args = array( | |
| 'hierarchical' => true, | |
| 'labels' => $labels, | |
| 'show_ui' => true, | |
| 'show_admin_column' => true, | |
| 'query_var' => true, | |
| 'rewrite' => array( 'slug' => 'recommendation' ), | |
| 'show_in_rest' => true, | |
| ); | |
| register_taxonomy( 'recommendations-type', array( 'recommendations', 'page' ), $args ); | |
| } | |
| add_action( 'init', 'SP_PS_register_recommendations_taxonomies' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment