Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shaunpalmer/fdb8633ae898fc17293537d6678eaa20 to your computer and use it in GitHub Desktop.
Save shaunpalmer/fdb8633ae898fc17293537d6678eaa20 to your computer and use it in GitHub Desktop.
recommendations taxonomies
// 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