generated from pascalmartineau/wp-skeleton
feat: Initial plugins and theme
All checks were successful
WordPress deployment / deploy (push) Successful in 9s
All checks were successful
WordPress deployment / deploy (push) Successful in 9s
This commit is contained in:
92
wp-content/themes/ccat/includes/taxonomies/discipline.php
Normal file
92
wp-content/themes/ccat/includes/taxonomies/discipline.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
// Register 'discipline' taxonomy
|
||||
add_action( 'init', 'ccat_discipline_register_taxonomy' );
|
||||
function ccat_discipline_register_taxonomy() {
|
||||
register_taxonomy(
|
||||
'discipline',
|
||||
array( 'contributor', 'event' ),
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __( "Disciplines", 'ccat' ),
|
||||
'singular_name' => __( "Discipline", 'ccat' ),
|
||||
'search_items' => __( "Search disciplines", 'ccat' ),
|
||||
'popular_items' => __( "Popular disciplines", 'ccat' ),
|
||||
'all_items' => __( "All disciplines", 'ccat' ),
|
||||
'parent_item' => __( "Parent discipline", 'ccat' ),
|
||||
'parent_item_colon' => __( "Parent discipline:", 'ccat' ),
|
||||
'edit_item' => __( "Edit discipline", 'ccat' ),
|
||||
'update_item' => __( "Update discipline", 'ccat' ),
|
||||
'view_item' => __( "View discipline", 'ccat' ),
|
||||
'add_new_item' => __( "New discipline", 'ccat' ),
|
||||
'new_item_name' => __( "New discipline", 'ccat' ),
|
||||
'separate_items_with_commas' => __( "Separate disciplines with commas", 'ccat' ),
|
||||
'add_or_remove_items' => __( "Add or remove disciplines", 'ccat' ),
|
||||
'choose_from_most_used' => __( "Choose from the most used disciplines", 'ccat' ),
|
||||
'not_found' => __( "No disciplines found.", 'ccat' ),
|
||||
'no_terms' => __( "No disciplines", 'ccat' ),
|
||||
'menu_name' => __( "Disciplines", 'ccat' ),
|
||||
'items_list_navigation' => __( "Disciplines list navigation", 'ccat' ),
|
||||
'items_list' => __( "Disciplines list", 'ccat' ),
|
||||
'most_used' => __( "Most used", 'ccat' ),
|
||||
'back_to_items' => __( "← Back to disciplines", 'ccat' ),
|
||||
),
|
||||
'public' => false,
|
||||
'hierarchical' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => false,
|
||||
'query_var' => true,
|
||||
'show_in_rest' => true,
|
||||
'rest_base' => 'discipline',
|
||||
'rest_controller_class' => 'WP_REST_Terms_Controller',
|
||||
'meta_box_cb' => false,
|
||||
'show_in_graphql' => true,
|
||||
'graphql_single_name' => "Discipline",
|
||||
'graphql_plural_name' => "Disciplines",
|
||||
'graphql_interfaces' => array( 'Node' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Custom 'discipline' term updated messages
|
||||
add_filter( 'term_updated_messages', 'ccat_discipline_term_updated_messages' );
|
||||
function ccat_discipline_term_updated_messages( $messages ) {
|
||||
$messages['discipline'] = array(
|
||||
0 => '',
|
||||
1 => __( "Discipline added.", 'ccat' ),
|
||||
2 => __( "Discipline deleted.", 'ccat' ),
|
||||
3 => __( "Discipline updated.", 'ccat' ),
|
||||
4 => __( "Discipline not added.", 'ccat' ),
|
||||
5 => __( "Discipline not updated.", 'ccat' ),
|
||||
6 => __( "Disciplines deleted.", 'ccat' ),
|
||||
);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
// Add a top-level menu for the 'discipline' taxonomy in the admin menu
|
||||
add_action( 'admin_menu', 'ccat_discripline_admin_menu' );
|
||||
function ccat_discripline_admin_menu() {
|
||||
add_menu_page(
|
||||
'Disciplines',
|
||||
'Disciplines',
|
||||
'manage_options',
|
||||
'edit-tags.php?taxonomy=discipline',
|
||||
'',
|
||||
'dashicons-microphone',
|
||||
5
|
||||
);
|
||||
}
|
||||
|
||||
// Set the 'discipline' taxonomy menu as active in the admin menu
|
||||
add_filter( 'parent_file', 'ccat_discipline_parent_file' );
|
||||
function ccat_discipline_parent_file( $parent_file ) {
|
||||
global $current_screen;
|
||||
if ( isset( $current_screen->taxonomy ) && $current_screen->taxonomy === 'discipline' ) {
|
||||
$parent_file = 'edit-tags.php?taxonomy=discipline';
|
||||
}
|
||||
return $parent_file;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
// Register 'project-category' taxonomy
|
||||
add_action( 'init', 'ccat_project_category_register_taxonomy' );
|
||||
function ccat_project_category_register_taxonomy() {
|
||||
register_taxonomy(
|
||||
'project_category',
|
||||
array( 'project' ),
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __( "Project categories", 'ccat' ),
|
||||
'singular_name' => __( "Project category", 'ccat' ),
|
||||
'search_items' => __( "Search project-categories", 'ccat' ),
|
||||
'popular_items' => __( "Popular project-categories", 'ccat' ),
|
||||
'all_items' => __( "All project-categories", 'ccat' ),
|
||||
'parent_item' => __( "Parent project-category", 'ccat' ),
|
||||
'parent_item_colon' => __( "Parent project-category:", 'ccat' ),
|
||||
'edit_item' => __( "Edit project-category", 'ccat' ),
|
||||
'update_item' => __( "Update project-category", 'ccat' ),
|
||||
'view_item' => __( "View project-category", 'ccat' ),
|
||||
'add_new_item' => __( "New project-category", 'ccat' ),
|
||||
'new_item_name' => __( "New project-category", 'ccat' ),
|
||||
'separate_items_with_commas' => __( "Separate project-categories with commas", 'ccat' ),
|
||||
'add_or_remove_items' => __( "Add or remove project-categories", 'ccat' ),
|
||||
'choose_from_most_used' => __( "Choose from the most used project-categories", 'ccat' ),
|
||||
'not_found' => __( "No project-categories found.", 'ccat' ),
|
||||
'no_terms' => __( "No project-categories", 'ccat' ),
|
||||
'menu_name' => __( "Project categories", 'ccat' ),
|
||||
'items_list_navigation' => __( "Project categories list navigation", 'ccat' ),
|
||||
'items_list' => __( "Project categories list", 'ccat' ),
|
||||
'most_used' => __( "Most used", 'ccat' ),
|
||||
'back_to_items' => __( "← Back to project-categories", 'ccat' ),
|
||||
),
|
||||
'public' => false,
|
||||
'hierarchical' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => true,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => false,
|
||||
'query_var' => true,
|
||||
'show_in_rest' => true,
|
||||
'rest_base' => 'project_category',
|
||||
'rest_controller_class' => 'WP_REST_Terms_Controller',
|
||||
'meta_box_cb' => false,
|
||||
'show_in_graphql' => true,
|
||||
'graphql_single_name' => "ProjectCategory",
|
||||
'graphql_plural_name' => "ProjectCategories",
|
||||
'graphql_interfaces' => array( 'Node' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Custom 'project-category' term updated messages
|
||||
add_filter( 'term_updated_messages', 'ccat_project_category_term_updated_messages' );
|
||||
function ccat_project_category_term_updated_messages( $messages ) {
|
||||
$messages['project_category'] = array(
|
||||
0 => '',
|
||||
1 => __( "Project category added.", 'ccat' ),
|
||||
2 => __( "Project category deleted.", 'ccat' ),
|
||||
3 => __( "Project category updated.", 'ccat' ),
|
||||
4 => __( "Project category not added.", 'ccat' ),
|
||||
5 => __( "Project category not updated.", 'ccat' ),
|
||||
6 => __( "Project categories deleted.", 'ccat' ),
|
||||
);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
// Register 'resource-category' taxonomy
|
||||
add_action( 'init', 'ccat_resource_category_register_taxonomy' );
|
||||
function ccat_resource_category_register_taxonomy() {
|
||||
register_taxonomy(
|
||||
'resource_category',
|
||||
array( 'resource' ),
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __( "Resource categories", 'ccat' ),
|
||||
'singular_name' => __( "Resource category", 'ccat' ),
|
||||
'search_items' => __( "Search resource-categories", 'ccat' ),
|
||||
'popular_items' => __( "Popular resource-categories", 'ccat' ),
|
||||
'all_items' => __( "All resource-categories", 'ccat' ),
|
||||
'parent_item' => __( "Parent resource-category", 'ccat' ),
|
||||
'parent_item_colon' => __( "Parent resource-category:", 'ccat' ),
|
||||
'edit_item' => __( "Edit resource-category", 'ccat' ),
|
||||
'update_item' => __( "Update resource-category", 'ccat' ),
|
||||
'view_item' => __( "View resource-category", 'ccat' ),
|
||||
'add_new_item' => __( "New resource-category", 'ccat' ),
|
||||
'new_item_name' => __( "New resource-category", 'ccat' ),
|
||||
'separate_items_with_commas' => __( "Separate resource-categories with commas", 'ccat' ),
|
||||
'add_or_remove_items' => __( "Add or remove resource-categories", 'ccat' ),
|
||||
'choose_from_most_used' => __( "Choose from the most used resource-categories", 'ccat' ),
|
||||
'not_found' => __( "No resource-categories found.", 'ccat' ),
|
||||
'no_terms' => __( "No resource-categories", 'ccat' ),
|
||||
'menu_name' => __( "Resource categories", 'ccat' ),
|
||||
'items_list_navigation' => __( "Resource categories list navigation", 'ccat' ),
|
||||
'items_list' => __( "Resource categories list", 'ccat' ),
|
||||
'most_used' => __( "Most used", 'ccat' ),
|
||||
'back_to_items' => __( "← Back to resource-categories", 'ccat' ),
|
||||
),
|
||||
'public' => false,
|
||||
'hierarchical' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => true,
|
||||
'show_in_nav_menus' => false,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => false,
|
||||
'query_var' => true,
|
||||
'show_in_rest' => true,
|
||||
'rest_base' => 'resource_category',
|
||||
'rest_controller_class' => 'WP_REST_Terms_Controller',
|
||||
'meta_box_cb' => false,
|
||||
'show_in_graphql' => true,
|
||||
'graphql_single_name' => "ResourceCategory",
|
||||
'graphql_plural_name' => "ResourceCategories",
|
||||
'graphql_interfaces' => array( 'Node' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Custom 'resource-category' term updated messages
|
||||
add_filter( 'term_updated_messages', 'ccat_resource_category_term_updated_messages' );
|
||||
function ccat_resource_category_term_updated_messages( $messages ) {
|
||||
$messages['resource_category'] = array(
|
||||
0 => '',
|
||||
1 => __( "Resource category added.", 'ccat' ),
|
||||
2 => __( "Resource category deleted.", 'ccat' ),
|
||||
3 => __( "Resource category updated.", 'ccat' ),
|
||||
4 => __( "Resource category not added.", 'ccat' ),
|
||||
5 => __( "Resource category not updated.", 'ccat' ),
|
||||
6 => __( "Resource categories deleted.", 'ccat' ),
|
||||
);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
Reference in New Issue
Block a user