feat: Initial plugins and theme
All checks were successful
WordPress deployment / deploy (push) Successful in 9s

This commit is contained in:
2025-08-27 10:46:59 -04:00
parent 79b4fc7565
commit d225837d7b
49 changed files with 9448 additions and 6 deletions

View File

@@ -0,0 +1,31 @@
<?php
// Setup theme
add_action( 'after_setup_theme', 'ccat_after_setup_theme' );
function ccat_after_setup_theme() {
// Load textdomain
load_theme_textdomain( 'ccat', get_theme_file_path( 'languages' ) );
// Theme features
add_theme_support( 'custom-logo' );
add_theme_support( 'editor-styles' );
add_theme_support( 'post-thumbnails' );
// add_theme_support( 'woocommerce' );
remove_theme_support( 'core-block-patterns' );
// Register menus
register_nav_menu( 'main', "Menu principal" );
register_nav_menu( 'top', "Menu du haut" );
// Register sidebars
}
// Disable unwanted permalinks
add_action( 'template_redirect', 'ccat_disable_permalinks' );
function ccat_disable_permalinks() {
global $wp_query;
if ( is_author() || is_attachment() || is_date() ) {
$wp_query->set_404();
status_header( 404 );
}
}

View File

@@ -0,0 +1,88 @@
<?php
// Register 'contributor' post type
add_action( 'init', 'ccat_contributor_register_post_type' );
function ccat_contributor_register_post_type() {
register_post_type(
'contributor',
array(
'labels' => array(
'name' => __( "Contributors", 'ccat' ),
'menu_name' => __( "Contributors", 'ccat' ),
'singular_name' => __( "Contributor", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Contributor", 'ccat' ),
'new_item' => __( "New Contributor", 'ccat' ),
'edit_item' => __( "Edit Contributor", 'ccat' ),
'view_item' => __( "View Contributor", 'ccat' ),
'view_items' => __( "View Contributors", 'ccat' ),
'search_items' => __( "Search Contributors", 'ccat' ),
'not_found' => __( "No Contributors found", 'ccat' ),
'not_found_in_trash' => __( "No Contributors found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Contributor:", 'ccat' ),
'all_items' => __( "All Contributors", 'ccat' ),
'archives' => __( "Contributor Archives", 'ccat' ),
'attributes' => __( "Contributor Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Contributor", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Contributor", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Contributors list", 'ccat' ),
'items_list_navigation' => __( "Contributors list navigation", 'ccat' ),
'items_list' => __( "Contributors list", 'ccat' ),
'item_published' => __( "Contributor published.", 'ccat' ),
'item_published_privately' => __( "Contributor published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Contributor reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Contributor scheduled.", 'ccat' ),
'item_updated' => __( "Contributor updated.", 'ccat' ),
),
'public' => true,
'hierarchical' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'thumbnail', 'author', 'excerpt', 'revisions' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'contributeur',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-art',
'show_in_rest' => true,
'rest_base' => 'contributor',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Contributor",
'graphql_plural_name' => "Contributors",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'contributor' post updated messages
add_filter( 'post_updated_messages', 'ccat_contributor_post_updated_messages' );
function ccat_contributor_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Contributor", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Contributor", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Contributor", 'ccat' ) );
$messages['contributor'] = array(
0 => '',
1 => __( "Contributor updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Contributor updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Contributor restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Contributor published.", 'ccat' ) . $view_post_link_html,
7 => __( "Contributor saved.", 'ccat' ),
8 => __( "Contributor submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Contributor scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Contributor draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,88 @@
<?php
// Register 'event' post type
add_action( 'init', 'ccat_event_register_post_type' );
function ccat_event_register_post_type() {
register_post_type(
'event',
array(
'labels' => array(
'name' => __( "Events", 'ccat' ),
'menu_name' => __( "Events", 'ccat' ),
'singular_name' => __( "Event", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Event", 'ccat' ),
'new_item' => __( "New Event", 'ccat' ),
'edit_item' => __( "Edit Event", 'ccat' ),
'view_item' => __( "View Event", 'ccat' ),
'view_items' => __( "View Events", 'ccat' ),
'search_items' => __( "Search Events", 'ccat' ),
'not_found' => __( "No Events found", 'ccat' ),
'not_found_in_trash' => __( "No Events found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Event:", 'ccat' ),
'all_items' => __( "All Events", 'ccat' ),
'archives' => __( "Event Archives", 'ccat' ),
'attributes' => __( "Event Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Event", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Event", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Events list", 'ccat' ),
'items_list_navigation' => __( "Events list navigation", 'ccat' ),
'items_list' => __( "Events list", 'ccat' ),
'item_published' => __( "Event published.", 'ccat' ),
'item_published_privately' => __( "Event published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Event reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Event scheduled.", 'ccat' ),
'item_updated' => __( "Event updated.", 'ccat' ),
),
'public' => true,
'hierarchical' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'thumbnail', 'excerpt', 'revisions', 'page-attributes' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'evenement',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-calendar',
'show_in_rest' => true,
'rest_base' => 'event',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Event",
'graphql_plural_name' => "Events",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'event' post updated messages
add_filter( 'post_updated_messages', 'ccat_event_post_updated_messages' );
function ccat_event_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Event", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Event", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Event", 'ccat' ) );
$messages['event'] = array(
0 => '',
1 => __( "Event updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Event updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Event restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Event published.", 'ccat' ) . $view_post_link_html,
7 => __( "Event saved.", 'ccat' ),
8 => __( "Event submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Event scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Event draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,89 @@
<?php
// Register 'location' post type
add_action( 'init', 'ccat_location_register_post_type' );
function ccat_location_register_post_type() {
register_post_type(
'location',
array(
'labels' => array(
'name' => __( "Locations", 'ccat' ),
'menu_name' => __( "Locations", 'ccat' ),
'singular_name' => __( "Location", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Location", 'ccat' ),
'new_item' => __( "New Location", 'ccat' ),
'edit_item' => __( "Edit Location", 'ccat' ),
'view_item' => __( "View Location", 'ccat' ),
'view_items' => __( "View Locations", 'ccat' ),
'search_items' => __( "Search Locations", 'ccat' ),
'not_found' => __( "No Locations found", 'ccat' ),
'not_found_in_trash' => __( "No Locations found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Location:", 'ccat' ),
'all_items' => __( "All Locations", 'ccat' ),
'archives' => __( "Location Archives", 'ccat' ),
'attributes' => __( "Location Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Location", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Location", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Locations list", 'ccat' ),
'items_list_navigation' => __( "Locations list navigation", 'ccat' ),
'items_list' => __( "Locations list", 'ccat' ),
'item_published' => __( "Location published.", 'ccat' ),
'item_published_privately' => __( "Location published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Location reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Location scheduled.", 'ccat' ),
'item_updated' => __( "Location updated.", 'ccat' ),
),
'public' => false,
'hierarchical' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'thumbnail', 'excerpt', 'revisions' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'emplacement',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-location',
'show_in_rest' => true,
'rest_base' => 'location',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Location",
'graphql_plural_name' => "Locations",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'location' post updated messages
add_filter( 'post_updated_messages', 'ccat_location_post_updated_messages' );
function ccat_location_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Location", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Location", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Location", 'ccat' ) );
$messages['location'] = array(
0 => '',
1 => __( "Location updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Location updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Location restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Location published.", 'ccat' ) . $view_post_link_html,
7 => __( "Location saved.", 'ccat' ),
8 => __( "Location submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Location scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Location draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,88 @@
<?php
// Register 'membership' post type
add_action( 'init', 'ccat_membership_register_post_type' );
function ccat_membership_register_post_type() {
register_post_type(
'membership',
array(
'labels' => array(
'name' => __( "Memberships", 'ccat' ),
'menu_name' => __( "Memberships", 'ccat' ),
'singular_name' => __( "Membership", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Membership", 'ccat' ),
'new_item' => __( "New Membership", 'ccat' ),
'edit_item' => __( "Edit Membership", 'ccat' ),
'view_item' => __( "View Membership", 'ccat' ),
'view_items' => __( "View Memberships", 'ccat' ),
'search_items' => __( "Search Memberships", 'ccat' ),
'not_found' => __( "No Memberships found", 'ccat' ),
'not_found_in_trash' => __( "No Memberships found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Membership:", 'ccat' ),
'all_items' => __( "All Memberships", 'ccat' ),
'archives' => __( "Membership Archives", 'ccat' ),
'attributes' => __( "Membership Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Membership", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Membership", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Memberships list", 'ccat' ),
'items_list_navigation' => __( "Memberships list navigation", 'ccat' ),
'items_list' => __( "Memberships list", 'ccat' ),
'item_published' => __( "Membership published.", 'ccat' ),
'item_published_privately' => __( "Membership published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Membership reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Membership scheduled.", 'ccat' ),
'item_updated' => __( "Membership updated.", 'ccat' ),
),
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'thumbnail', 'author', 'revisions' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'membre',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-id',
'show_in_rest' => true,
'rest_base' => 'membership',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Membership",
'graphql_plural_name' => "Memberships",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'membership' post updated messages
add_filter( 'post_updated_messages', 'ccat_membership_post_updated_messages' );
function ccat_membership_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Membership", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Membership", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Membership", 'ccat' ) );
$messages['membership'] = array(
0 => '',
1 => __( "Membership updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Membership updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Membership restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Membership published.", 'ccat' ) . $view_post_link_html,
7 => __( "Membership saved.", 'ccat' ),
8 => __( "Membership submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Membership scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Membership draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,88 @@
<?php
// Register 'project' post type
add_action( 'init', 'ccat_project_register_post_type' );
function ccat_project_register_post_type() {
register_post_type(
'project',
array(
'labels' => array(
'name' => __( "Projects", 'ccat' ),
'menu_name' => __( "Projects", 'ccat' ),
'singular_name' => __( "Project", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Project", 'ccat' ),
'new_item' => __( "New Project", 'ccat' ),
'edit_item' => __( "Edit Project", 'ccat' ),
'view_item' => __( "View Project", 'ccat' ),
'view_items' => __( "View Projects", 'ccat' ),
'search_items' => __( "Search Projects", 'ccat' ),
'not_found' => __( "No Projects found", 'ccat' ),
'not_found_in_trash' => __( "No Projects found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Project:", 'ccat' ),
'all_items' => __( "All Projects", 'ccat' ),
'archives' => __( "Project Archives", 'ccat' ),
'attributes' => __( "Project Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Project", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Project", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Projects list", 'ccat' ),
'items_list_navigation' => __( "Projects list navigation", 'ccat' ),
'items_list' => __( "Projects list", 'ccat' ),
'item_published' => __( "Project published.", 'ccat' ),
'item_published_privately' => __( "Project published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Project reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Project scheduled.", 'ccat' ),
'item_updated' => __( "Project updated.", 'ccat' ),
),
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
'supports' => array( 'title', 'thumbnail', 'excerpt', 'revisions' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'projet',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-portfolio',
'show_in_rest' => true,
'rest_base' => 'project',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Project",
'graphql_plural_name' => "Projects",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'project' post updated messages
add_filter( 'post_updated_messages', 'ccat_project_post_updated_messages' );
function ccat_project_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Project", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Project", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Project", 'ccat' ) );
$messages['project'] = array(
0 => '',
1 => __( "Project updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Project updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Project restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Project published.", 'ccat' ) . $view_post_link_html,
7 => __( "Project saved.", 'ccat' ),
8 => __( "Project submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Project scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Project draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,85 @@
<?php
// Register 'representation' post type
add_action( 'init', 'ccat_representation_register_post_type' );
function ccat_representation_register_post_type() {
register_post_type(
'representation',
array(
'labels' => array(
'name' => __( "Representations", 'ccat' ),
'menu_name' => __( "Representations", 'ccat' ),
'singular_name' => __( "Representation", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Representation", 'ccat' ),
'new_item' => __( "New Representation", 'ccat' ),
'edit_item' => __( "Edit Representation", 'ccat' ),
'view_item' => __( "View Representation", 'ccat' ),
'view_items' => __( "View Representations", 'ccat' ),
'search_items' => __( "Search Representations", 'ccat' ),
'not_found' => __( "No Representations found", 'ccat' ),
'not_found_in_trash' => __( "No Representations found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Representation:", 'ccat' ),
'all_items' => __( "All Representations", 'ccat' ),
'archives' => __( "Representation Archives", 'ccat' ),
'attributes' => __( "Representation Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Representation", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Representation", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Representations list", 'ccat' ),
'items_list_navigation' => __( "Representations list navigation", 'ccat' ),
'items_list' => __( "Representations list", 'ccat' ),
'item_published' => __( "Representation published.", 'ccat' ),
'item_published_privately' => __( "Representation published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Representation reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Representation scheduled.", 'ccat' ),
'item_updated' => __( "Representation updated.", 'ccat' ),
),
'public' => false,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'revisions' ),
'has_archive' => false,
'rewrite' => false,
'query_var' => true,
'menu_icon' => 'dashicons-tickets-alt',
'show_in_rest' => true,
'rest_base' => 'representation',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Representation",
'graphql_plural_name' => "Representations",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'representation' post updated messages
add_filter( 'post_updated_messages', 'ccat_representation_post_updated_messages' );
function ccat_representation_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Representation", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Representation", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Representation", 'ccat' ) );
$messages['representation'] = array(
0 => '',
1 => __( "Representation updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Representation updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Representation restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Representation published.", 'ccat' ) . $view_post_link_html,
7 => __( "Representation saved.", 'ccat' ),
8 => __( "Representation submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Representation scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Representation draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,88 @@
<?php
// Register 'resource' post type
add_action( 'init', 'ccat_resource_register_post_type' );
function ccat_resource_register_post_type() {
register_post_type(
'resource',
array(
'labels' => array(
'name' => __( "Resources", 'ccat' ),
'menu_name' => __( "Resources", 'ccat' ),
'singular_name' => __( "Resource", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Resource", 'ccat' ),
'new_item' => __( "New Resource", 'ccat' ),
'edit_item' => __( "Edit Resource", 'ccat' ),
'view_item' => __( "View Resource", 'ccat' ),
'view_items' => __( "View Resources", 'ccat' ),
'search_items' => __( "Search Resources", 'ccat' ),
'not_found' => __( "No Resources found", 'ccat' ),
'not_found_in_trash' => __( "No Resources found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Resource:", 'ccat' ),
'all_items' => __( "All Resources", 'ccat' ),
'archives' => __( "Resource Archives", 'ccat' ),
'attributes' => __( "Resource Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Resource", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Resource", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Resources list", 'ccat' ),
'items_list_navigation' => __( "Resources list navigation", 'ccat' ),
'items_list' => __( "Resources list", 'ccat' ),
'item_published' => __( "Resource published.", 'ccat' ),
'item_published_privately' => __( "Resource published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Resource reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Resource scheduled.", 'ccat' ),
'item_updated' => __( "Resource updated.", 'ccat' ),
),
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'thumbnail', 'excerpt', 'revisions' ),
'has_archive' => false,
'rewrite' => array(
'slug' => 'ressource',
'with_front' => false,
),
'query_var' => true,
'menu_icon' => 'dashicons-admin-tools',
'show_in_rest' => true,
'rest_base' => 'resource',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Resource",
'graphql_plural_name' => "Resources",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'resource' post updated messages
add_filter( 'post_updated_messages', 'ccat_resource_post_updated_messages' );
function ccat_resource_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Resource", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Resource", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Resource", 'ccat' ) );
$messages['resource'] = array(
0 => '',
1 => __( "Resource updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Resource updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Resource restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Resource published.", 'ccat' ) . $view_post_link_html,
7 => __( "Resource saved.", 'ccat' ),
8 => __( "Resource submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Resource scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Resource draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View File

@@ -0,0 +1,85 @@
<?php
// Register 'template' post type
add_action( 'init', 'ccat_template_register_post_type' );
function ccat_template_register_post_type() {
register_post_type(
'template',
array(
'labels' => array(
'name' => __( "Templates", 'ccat' ),
'menu_name' => __( "Templates", 'ccat' ),
'singular_name' => __( "Template", 'ccat' ),
'add_new' => __( "Add New", 'ccat' ),
'add_new_item' => __( "Add New Template", 'ccat' ),
'new_item' => __( "New Template", 'ccat' ),
'edit_item' => __( "Edit Template", 'ccat' ),
'view_item' => __( "View Template", 'ccat' ),
'view_items' => __( "View Templates", 'ccat' ),
'search_items' => __( "Search Templates", 'ccat' ),
'not_found' => __( "No Templates found", 'ccat' ),
'not_found_in_trash' => __( "No Templates found in trash", 'ccat' ),
'parent_item_colon' => __( "Parent Template:", 'ccat' ),
'all_items' => __( "All Templates", 'ccat' ),
'archives' => __( "Template Archives", 'ccat' ),
'attributes' => __( "Template Attributes", 'ccat' ),
'insert_into_item' => __( "Insert into Template", 'ccat' ),
'uploaded_to_this_item' => __( "Uploaded to this Template", 'ccat' ),
'featured_image' => __( "Featured Image", 'ccat' ),
'set_featured_image' => __( "Set featured image", 'ccat' ),
'remove_featured_image' => __( "Remove featured image", 'ccat' ),
'use_featured_image' => __( "Use as featured image", 'ccat' ),
'filter_items_list' => __( "Filter Templates list", 'ccat' ),
'items_list_navigation' => __( "Templates list navigation", 'ccat' ),
'items_list' => __( "Templates list", 'ccat' ),
'item_published' => __( "Template published.", 'ccat' ),
'item_published_privately' => __( "Template published privately.", 'ccat' ),
'item_reverted_to_draft' => __( "Template reverted to draft.", 'ccat' ),
'item_scheduled' => __( "Template scheduled.", 'ccat' ),
'item_updated' => __( "Template updated.", 'ccat' ),
),
'public' => false,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'supports' => array( 'title', 'revisions' ),
'has_archive' => false,
'rewrite' => false,
'query_var' => true,
'menu_icon' => 'dashicons-clipboard',
'show_in_rest' => true,
'rest_base' => 'template',
'rest_controller_class' => 'WP_REST_Posts_Controller',
'show_in_graphql' => true,
'graphql_single_name' => "Template",
'graphql_plural_name' => "Templates",
'graphql_interfaces' => array( 'Node' ),
)
);
}
// Custom 'template' post updated messages
add_filter( 'post_updated_messages', 'ccat_template_post_updated_messages' );
function ccat_template_post_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( get_preview_post_link( $post ) ), __( "Preview Template", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( "Preview Template", 'ccat' ) );
$scheduled_date = date_i18n( __( "M j, Y @ H:i", 'ccat' ), strtotime( $post->post_date ) );
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( "View Template", 'ccat' ) );
$messages['template'] = array(
0 => '',
1 => __( "Template updated.", 'ccat' ) . $view_post_link_html,
2 => __( "Custom field updated.", 'ccat' ),
3 => __( "Custom field deleted.", 'ccat' ),
4 => __( "Template updated.", 'ccat' ),
5 => isset( $_GET['revision'] ) ? sprintf( __( "Template restored to revision from %s", 'ccat' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( "Template published.", 'ccat' ) . $view_post_link_html,
7 => __( "Template saved.", 'ccat' ),
8 => __( "Template submitted.", 'ccat' ) . $preview_post_link_html,
9 => sprintf( __( 'Template scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Template draft updated.' ) . $preview_post_link_html,
);
return $messages;
}

View 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' => __( "&larr; 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;
}

View 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' => __( "&larr; 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;
}

View File

@@ -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' => __( "&larr; 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;
}

View File

@@ -0,0 +1,20 @@
<?php
// Disable ACF / ACFE modules
add_action( 'acf/init', 'ccat_acf_init' );
function ccat_acf_init() {
acf_update_setting( 'acfe/modules/block_types', false );
acf_update_setting( 'acfe/modules/categories', false );
acf_update_setting( 'acfe/modules/forms', false );
acf_update_setting( 'acfe/modules/options_pages', false );
acf_update_setting( 'acfe/modules/post_types', false );
acf_update_setting( 'acfe/modules/taxonomies', false );
acf_update_setting( 'acfe/modules/templates', false );
}
// Google Maps API key
add_filter( 'acf/fields/google_map/api', 'ccat_acf_google_map_api' );
function ccat_acf_google_map_api( $api ) {
$api['key'] = 'AIzaSyAg30RB3c6ICeAklV_9CSJ_80uPThr4Qn8';
return $api;
}