Skip to content

Instantly share code, notes, and snippets.

@oddevan

oddevan/Card.php

Last active Aug 30, 2019
Embed
What would you like to do?
<?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
You can’t perform that action at this time.