Skip to content

Commit

Permalink
Merge pull request #2316 from WordPress/feature/validposttypeslug-upd…
Browse files Browse the repository at this point in the history
…ate-reserved-names-list

NamingConventions/ValidPostTypeSlug: update the reserved post types list
  • Loading branch information
dingo-d authored Jul 23, 2023
2 parents d65600c + af770df commit 0a5905e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,33 @@ final class ValidPostTypeSlugSniff extends AbstractFunctionParameterSniff {
/**
* Array of reserved post type names which can not be used by themes and plugins.
*
* Source: {@link https://developer.wordpress.org/reference/functions/register_post_type/#reserved-post-types}
*
* Last update: July 2023 for WP 6.3 at https://github.com/WordPress/wordpress-develop/commit/6281ce432c50345a57768bf53854d9b65b6cdd52
*
* @since 2.2.0
*
* @var array
*/
protected $reserved_names = array(
'post' => true,
'page' => true,
'action' => true, // Not a WP post type, but prevents other problems.
'attachment' => true,
'revision' => true,
'nav_menu_item' => true,
'author' => true, // Not a WP post type, but prevents other problems.
'custom_css' => true,
'customize_changeset' => true,
'nav_menu_item' => true,
'oembed_cache' => true,
'order' => true, // Not a WP post type, but prevents other problems.
'page' => true,
'post' => true,
'revision' => true,
'theme' => true, // Not a WP post type, but prevents other problems.
'user_request' => true,
'wp_block' => true,
'action' => true,
'author' => true,
'order' => true,
'theme' => true,
'wp_global_styles' => true,
'wp_navigation' => true,
'wp_template' => true,
'wp_template_part' => true,
);

/**
Expand Down

0 comments on commit 0a5905e

Please sign in to comment.