Skip to content

Commit 022288a

Browse files
bredeclgfazioli
authored andcommitted
Add extra code to Custom Post Type to allow to be viewed and used in Admin Panel.
Add info for support WP fields with the CPT.
1 parent 56deeb1 commit 022288a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pages/docs/ServicesProvider/custom-post-types.mdx

+25
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,31 @@ class MyCustomPostType extends WordPressCustomPostTypeServiceProvider {
5555
*/
5656
protected $plural = 'Starships';
5757

58+
/**
59+
* Whether to include the post type in the REST API.
60+
* Set this to true for the post type to be available in the block editor.
61+
*
62+
* @var bool
63+
*/
64+
protected $showInRest = true;
65+
66+
/**
67+
* Whether to generate a default UI for managing this post type in the admin.
68+
* If not set, the default is inherited from public.
69+
*
70+
* @var bool
71+
*/
72+
protected $showUI = true;
73+
74+
/**
75+
* An alias for calling add_post_type_support() directly. Defaults to title and editor.
76+
* See {@link add_post_type_support()} for documentation.
77+
*
78+
* @var array
79+
*/
80+
protected $supports = ['title', 'editor', 'thumbnail', 'excerpt']; // etc..
81+
82+
5883
/**
5984
* You may override this method in order to register your own actions and filters.
6085
*

0 commit comments

Comments
 (0)