-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: End 2 End tests on the sidebar premalinkl for CPT's. (#13060)
- Loading branch information
1 parent
3f23b1a
commit d8f3ec3
Showing
2 changed files
with
104 additions
and
0 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,68 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Gutenberg Test Custom Post Types | ||
* Plugin URI: https://github.com/WordPress/gutenberg | ||
* Author: Gutenberg Team | ||
* | ||
* @package gutenberg-test-custom-post-types | ||
*/ | ||
|
||
/** | ||
* Registers a custom post type that is public_queryable but not public. | ||
*/ | ||
function public_queryable_true_public_false_cpt() { | ||
$public_queryable_true_public_false = 'public_q_not_public'; | ||
register_post_type( | ||
$public_queryable_true_public_false, | ||
array( | ||
'label' => 'PublicQNotPublic', | ||
'show_in_rest' => true, | ||
'public' => false, | ||
'publicly_queryable' => true, | ||
'supports' => array( 'title', 'editor', 'revisions' ), | ||
'show_ui' => true, | ||
'show_in_menu' => true, | ||
) | ||
); | ||
} | ||
add_action( 'init', 'public_queryable_true_public_false_cpt' ); | ||
|
||
/** | ||
* Registers a custom post type that is public but not public_queryable. | ||
*/ | ||
function public_queryable_false_public_true_cpt() { | ||
$public_queryable_false_public_true = 'not_public_q_public'; | ||
register_post_type( | ||
$public_queryable_false_public_true, | ||
array( | ||
'label' => 'NotPublicQPublic', | ||
'show_in_rest' => true, | ||
'public' => true, | ||
'publicly_queryable' => false, | ||
'supports' => array( 'title', 'editor', 'revisions' ), | ||
'show_ui' => true, | ||
'show_in_menu' => true, | ||
) | ||
); | ||
} | ||
add_action( 'init', 'public_queryable_false_public_true_cpt' ); | ||
|
||
/** | ||
* Registers a custom post type that is public and public_queryable. | ||
*/ | ||
function public_queryable_true_public_true_cpt() { | ||
$public_queryable_true_public_true = 'public_q_public'; | ||
register_post_type( | ||
$public_queryable_true_public_true, | ||
array( | ||
'label' => 'PublicQueryPublic', | ||
'show_in_rest' => true, | ||
'public' => true, | ||
'publicly_queryable' => true, | ||
'supports' => array( 'title', 'editor', 'revisions' ), | ||
'show_ui' => true, | ||
'show_in_menu' => true, | ||
) | ||
); | ||
} | ||
add_action( 'init', 'public_queryable_true_public_true_cpt' ); |