Skip to content

Instantly share code, notes, and snippets.

@oddevan
Last active August 30, 2019 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oddevan/e3798b90256d6dd67d06754ca2e17e8c to your computer and use it in GitHub Desktop.
Save oddevan/e3798b90256d6dd67d06754ca2e17e8c to your computer and use it in GitHub Desktop.
<?php
namespace oddEvan\TrainerDB\Content\PostType;
use WebDevStudios\OopsWP\Structure\Content\PostType;
class Card extends PostType {
protected $slug = 'card';
protected function get_labels() : array {
return [
'name' => _x( 'Cards', 'Post Type General Name', 'trainerdb' ),
'singular_name' => _x( 'Card', 'Post Type Singular Name', 'trainerdb' ),
//other labels go here
];
}
protected function get_args() : array {
return [
'label' => __( 'Card', 'trainerdb' ),
'description' => __( 'A particular card', 'trainerdb' ),
'supports' => [ 'title', 'thumbnail', 'custom-fields' ],
'hierarchical' => false,
'public' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-share-alt',
'capability_type' => 'post',
'show_in_rest' => true,
'taxonomies' => [ 'set', 'card_hash' ],
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment