WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 16 months ago

#37372 new defect (bug)

missing "edit permalink button" below the title

Reported by: realblueorange Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5.3
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

With posts and pages there is an "edit permalink button" below the title. Also, permalinks change when the title is changed.

For custom posts that does not seem to work in the same way:

For the function register_post_type() there is a 'public' argument which is merely a way of defining 4 other arguments in 1. If you set that to false and then set 'show_ui' to true to get the user interface back you get the complete user interface except the "edit permalink button" below the title. Also, permalinks do not change when the title is changed.

That seems like a bug and not like intended functionality.

Change History (2)

#1 follow-up: @achbed
16 months ago

The reason is that querying posts must include the post type in some fashion. A permalink simply maps to an internal post query. So in order to use the permalink system, you must have publicly_queryable set to true. Setting public to false also changes this setting to false.

Last edited 16 months ago by achbed (previous) (diff)

#2 in reply to: ↑ 1 @realblueorange
16 months ago

Replying to achbed:

The reason is that querying posts must include the post type in some fashion. A permalink simply maps to an internal post query. So in order to use the permalink system, you must have publicly_queryable set to true. Setting public to false also changes this setting to false.

If I understand the register_post_type() function correctly the 'public' argument is a way of setting 4 other arguments at once.

The value true implies exclude_from_search: false, publicly_queryable: true, show_in_nav_menus: true, and show_ui: true.

Setting it to false implies: exclude_from_search: true, publicly_queryable: false, show_in_nav_menus: false, and show_ui: false

I need exclude_from_search: true, publicly_queryable: false, show_in_nav_menus: false, and show_ui: true.

I would expect that setting 'public' to false and 'show_ui' to true would result in the normal user interface, including the "edit permalink button" below the title. And, I do need the permalinks.

By the way: I have 'publicly_queryable' set to false, but that does not mean I cannot use them or show them. They do have permalinks that are useable.

EDIT: just noticed that you get the "edit permalinks button below the title" if you have public=true AND publicly_queryable=true.
I do not want the website to be queryable other than my permalinks. And that is quite possible. I just do not see the edit button. I can change the slug which will do the trick also, but that is not the standard way of doing it...

Last edited 16 months ago by realblueorange (previous) (diff)
Note: See TracTickets for help on using tickets.