Last active
August 30, 2019 15:57
-
-
Save oddevan/e3798b90256d6dd67d06754ca2e17e8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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