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,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;
}