You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param string $slug The slug for the post type, used in URLs and query vars.
80
80
* @param array $additional_supports An array of additional features that the post type supports. Default features include 'title' and 'page-attributes'.
81
81
* @param bool $show_in_rest Whether to expose this post type in the WordPress REST API. Enables use of the Gutenberg editor and REST API queries.
82
+
* @param array $args An associative array of custom arguments to override or extend the default post type registration settings.
Copy file name to clipboardExpand all lines: src/Post_Type.php
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@
22
22
namespaceArrayPress\WP\CPT_Inline_List_Table;
23
23
24
24
/**
25
-
* Check if the class `Register_Post_Type` is defined, and if not, define it.
25
+
* Check if the class `\\Post_Type` is defined, and if not, define it.
26
26
*/
27
27
if ( ! class_exists( __NAMESPACE__ . '\\Post_Type' ) ) :
28
28
@@ -58,6 +58,11 @@ class Post_Type {
58
58
*/
59
59
protectedbool$show_in_rest = false;
60
60
61
+
/**
62
+
* @var array Custom arguments to override the default post type arguments.
63
+
*/
64
+
protectedarray$args;
65
+
61
66
/**
62
67
* Constructor for the custom post type registration class.
63
68
* This constructor initializes the post type with provided settings and automatically registers it with WordPress during the 'init' action.
@@ -68,14 +73,16 @@ class Post_Type {
68
73
* @param string $slug The slug for the post type, used in URLs and query vars.
69
74
* @param array $additional_supports An array of additional features that the post type supports. Default features include 'title' and 'page-attributes'.
70
75
* @param bool $show_in_rest Whether to expose this post type in the WordPress REST API. Enables use of the Gutenberg editor and REST API queries.
76
+
* @param array $args An associative array of custom arguments to override or extend the default post type registration settings.
0 commit comments