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( ' %2$s', esc_url( get_preview_post_link( $post ) ), __( "Preview Representation", 'ccat' ) );
$scheduled_post_link_html = sprintf( ' %2$s', 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( ' %2$s', 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.' ), '' . $scheduled_date . '' ) . $scheduled_post_link_html,
10 => __( 'Representation draft updated.' ) . $preview_post_link_html,
);
return $messages;
}