-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with Genre tax not showing up. Added more custom post types.
- Loading branch information
Showing
4 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Short Description Goes Here | ||
* | ||
* @author Chrispian H. Burks <[email protected]> | ||
* @package ChrispianHBurks\WorldBuilder\Content | ||
* @since 2019-10-04 | ||
*/ | ||
|
||
namespace ChrispianHBurks\WorldBuilder\Content\PostType; | ||
|
||
use WebDevStudios\OopsWP\Structure\Content\PostType; | ||
|
||
class Characters extends PostType { | ||
|
||
protected $slug = 'characters'; | ||
|
||
protected function get_args(): array { | ||
return [ | ||
'public' => true, | ||
'supports' => [ 'title', 'editor', 'revisions', 'excerpt', 'thumbnail' ], | ||
'show_ui' => true, | ||
// 'show_in_rest' => true, // Why dos this break showing the taxonomy on the page? | ||
'exclude_from_search' => false, | ||
'delete_with_user' => true, | ||
'taxonomies' => array( 'genre' ), | ||
'capability_type' => 'post', | ||
]; | ||
} | ||
|
||
protected function get_labels(): array { | ||
return [ | ||
'name' => _x( 'Characters', 'post type general name', 'wp-world-builder' ), | ||
'singular_name' => _x( 'Character', 'post type singular name', 'wp-world-builder' ), | ||
'menu_name' => _x( 'Characters', 'admin menu', 'wp-world-builder' ), | ||
'name_admin_bar' => _x( 'Characters', 'add new on admin bar', 'wp-world-builder' ), | ||
'add_new' => _x( 'Add New', 'void update', 'wp-world-builder' ), | ||
'add_new_item' => __( 'Add New Character', 'wp-world-builder' ), | ||
'new_item' => __( 'New Character', 'wp-world-builder' ), | ||
'edit_item' => __( 'Edit Character', 'wp-world-builder' ), | ||
'view_item' => __( 'View Character', 'wp-world-builder' ), | ||
'all_items' => __( 'All Characters', 'wp-world-builder' ), | ||
'search_items' => __( 'Search Characters', 'wp-world-builder' ), | ||
'parent_item_colon' => __( 'Parent Characters:', 'wp-world-builder' ), | ||
'not_found' => __( 'No stories found.', 'wp-world-builder' ), | ||
'not_found_in_trash' => __( 'No stories found in Trash.', 'wp-world-builder' ), | ||
]; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Short Description Goes Here | ||
* | ||
* @author Chrispian H. Burks <[email protected]> | ||
* @package ChrispianHBurks\WorldBuilder\Content | ||
* @since 2019-10-04 | ||
*/ | ||
|
||
namespace ChrispianHBurks\WorldBuilder\Content\PostType; | ||
|
||
use WebDevStudios\OopsWP\Structure\Content\PostType; | ||
|
||
class Places extends PostType { | ||
|
||
protected $slug = 'places'; | ||
|
||
protected function get_args(): array { | ||
return [ | ||
'public' => true, | ||
'supports' => [ 'title', 'editor', 'revisions', 'excerpt', 'thumbnail' ], | ||
'show_ui' => true, | ||
// 'show_in_rest' => true, // Why dos this break showing the taxonomy on the page? | ||
'exclude_from_search' => false, | ||
'delete_with_user' => true, | ||
'taxonomies' => array( 'genre' ), | ||
'capability_type' => 'post', | ||
]; | ||
} | ||
|
||
protected function get_labels(): array { | ||
return [ | ||
'name' => _x( 'Places', 'post type general name', 'wp-world-builder' ), | ||
'singular_name' => _x( 'Place', 'post type singular name', 'wp-world-builder' ), | ||
'menu_name' => _x( 'Places', 'admin menu', 'wp-world-builder' ), | ||
'name_admin_bar' => _x( 'Places', 'add new on admin bar', 'wp-world-builder' ), | ||
'add_new' => _x( 'Add New', 'void update', 'wp-world-builder' ), | ||
'add_new_item' => __( 'Add New Place', 'wp-world-builder' ), | ||
'new_item' => __( 'New Place', 'wp-world-builder' ), | ||
'edit_item' => __( 'Edit Place', 'wp-world-builder' ), | ||
'view_item' => __( 'View Place', 'wp-world-builder' ), | ||
'all_items' => __( 'All Places', 'wp-world-builder' ), | ||
'search_items' => __( 'Search Places', 'wp-world-builder' ), | ||
'parent_item_colon' => __( 'Parent Places:', 'wp-world-builder' ), | ||
'not_found' => __( 'No place found.', 'wp-world-builder' ), | ||
'not_found_in_trash' => __( 'No place found in Trash.', 'wp-world-builder' ), | ||
]; | ||
} | ||
|
||
} |
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