WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

Permalinks metabox not showing for non-public custom post types #38628

Open philiprichter opened 2 years ago

philiprichter commented 2 years ago

Description

When registering a custom post type with 'public' argument set to false, the permalinks meta box is not displayed any more (since Wordpress 5.9).

Step-by-step reproduction instructions

  1. Register new custom post type with 'public' => false
  2. Create new cpt post
  3. Permalinks metabox to set / change permalink is not visible any more
  4. Switching public to true will make permalink box visible

Screenshots, screen recording, code snippet

Screenshot 2022-02-08 at 15 23 23

Environment info

Wordpress 5.9, Twenty Twenty-Two theme, Multiple Browsers and OS

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Mamaduka commented 1 month ago

It is intentional when a post type isn't viewable; the editor won't render permalink options. The viewable value comes from is_post_type_viewable.