diff --git a/wp-includes/class-wp-post-type.php b/wp-includes/class-wp-post-type.php
index ba37a02fb5..143fe0a899 100644
a
|
b
|
final class WP_Post_Type { |
398 | 398 | 'register_meta_box_cb' => null, |
399 | 399 | 'taxonomies' => array(), |
400 | 400 | 'has_archive' => false, |
401 | | 'rewrite' => true, |
| 401 | 'rewrite' => null, |
402 | 402 | 'query_var' => true, |
403 | 403 | 'can_export' => true, |
404 | 404 | 'delete_with_user' => null, |
… |
… |
final class WP_Post_Type { |
418 | 418 | $args['publicly_queryable'] = $args['public']; |
419 | 419 | } |
420 | 420 | |
| 421 | // If not set, default to the setting for publicly_queriable. |
| 422 | if ( null === $args['rewrite'] ) { |
| 423 | $args['rewrite'] = $args['publicly_queryable']; |
| 424 | } |
| 425 | |
421 | 426 | // If not set, default to the setting for public. |
422 | 427 | if ( null === $args['show_ui'] ) { |
423 | 428 | $args['show_ui'] = $args['public']; |
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 7feb284e85..35e1237f67 100644
a
|
b
|
function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) |
1248 | 1248 | * $rewrite is enabled. Default false. |
1249 | 1249 | * @type bool|array $rewrite { |
1250 | 1250 | * Triggers the handling of rewrites for this post type. To prevent rewrite, set to false. |
1251 | | * Defaults to true, using $post_type as slug. To specify rewrite rules, an array can be |
1252 | | * passed with any of these keys: |
| 1251 | * Defaults to value of $publicly_queryable, using $post_type as slug. To specify rewrite rules, |
| 1252 | * an array can be passed with any of these keys: |
1253 | 1253 | * |
1254 | 1254 | * @type string $slug Customize the permastruct slug. Defaults to $post_type key. |
1255 | 1255 | * @type bool $with_front Whether the permastruct should be prepended with WP_Rewrite::$front. |