110 * |
110 * |
111 * @since 4.6.0 |
111 * @since 4.6.0 |
112 * @var bool $publicly_queryable |
112 * @var bool $publicly_queryable |
113 */ |
113 */ |
114 public $publicly_queryable = null; |
114 public $publicly_queryable = null; |
|
115 |
|
116 /** |
|
117 * Whether this post type is embeddable. |
|
118 * |
|
119 * Default is the value of $public. |
|
120 * |
|
121 * @since 6.8.0 |
|
122 * @var bool $embeddable |
|
123 */ |
|
124 public $embeddable = null; |
115 |
125 |
116 /** |
126 /** |
117 * Whether to generate and allow a UI for managing this post type in the admin. |
127 * Whether to generate and allow a UI for managing this post type in the admin. |
118 * |
128 * |
119 * Default is the value of $public. |
129 * Default is the value of $public. |
519 'description' => '', |
529 'description' => '', |
520 'public' => false, |
530 'public' => false, |
521 'hierarchical' => false, |
531 'hierarchical' => false, |
522 'exclude_from_search' => null, |
532 'exclude_from_search' => null, |
523 'publicly_queryable' => null, |
533 'publicly_queryable' => null, |
|
534 'embeddable' => null, |
524 'show_ui' => null, |
535 'show_ui' => null, |
525 'show_in_menu' => null, |
536 'show_in_menu' => null, |
526 'show_in_nav_menus' => null, |
537 'show_in_nav_menus' => null, |
527 'show_in_admin_bar' => null, |
538 'show_in_admin_bar' => null, |
528 'menu_position' => null, |
539 'menu_position' => null, |
563 // If not set, default to the setting for 'public'. |
574 // If not set, default to the setting for 'public'. |
564 if ( null === $args['show_ui'] ) { |
575 if ( null === $args['show_ui'] ) { |
565 $args['show_ui'] = $args['public']; |
576 $args['show_ui'] = $args['public']; |
566 } |
577 } |
567 |
578 |
|
579 // If not set, default to the setting for 'public'. |
|
580 if ( null === $args['embeddable'] ) { |
|
581 $args['embeddable'] = $args['public']; |
|
582 } |
|
583 |
568 // If not set, default rest_namespace to wp/v2 if show_in_rest is true. |
584 // If not set, default rest_namespace to wp/v2 if show_in_rest is true. |
569 if ( false === $args['rest_namespace'] && ! empty( $args['show_in_rest'] ) ) { |
585 if ( false === $args['rest_namespace'] && ! empty( $args['show_in_rest'] ) ) { |
570 $args['rest_namespace'] = 'wp/v2'; |
586 $args['rest_namespace'] = 'wp/v2'; |
571 } |
587 } |
572 |
588 |
971 } |
987 } |
972 |
988 |
973 self::$default_labels = array( |
989 self::$default_labels = array( |
974 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), |
990 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), |
975 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), |
991 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), |
976 'add_new' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), |
992 'add_new' => array( __( 'Add' ), __( 'Add' ) ), |
977 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), |
993 'add_new_item' => array( __( 'Add Post' ), __( 'Add Page' ) ), |
978 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), |
994 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), |
979 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), |
995 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), |
980 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), |
996 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), |
981 'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ), |
997 'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ), |
982 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), |
998 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), |