WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 9 months ago

#15218 closed defect (bug) (invalid)

Publish box (inner-sidebar) hidden in custom posts without show_ui

Reported by: 5ubliminal Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Posts, Post Types Keywords: close
Focuses: Cc:

Description

I'm pretty sure this is a bug as I can't figure out a reason for the following:


Create a new custom post type with show_ui => true (which is supposed to hide the menus for it if false). Create a post, go to the post edit screen. Now edit the plugin code and switch true to false for show_ui. Hit refresh and the inner-sidebar is gone.


Is this expected behavior and, if it is?!?!... how should it be handled? Some people need to manage the custom posts by themselves and not have then show up in the menu, trash can,... but they need the editor, scheduling and such.

Thanks a lot.

Change History (7)

comment:1 follow-up: nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1
  • Severity changed from blocker to normal

The bug you found is that post.php is accessible without show_ui.

show_ui is supposed to control edit.php and post.php.

In 3.1 there is show_in_menu that allows you to remove it from the menu. (#14145)

There is currently no way to disable edit.php and keep post.php however, you'd have to do that using hooks and a manual wp_die() as appropriate. How would you access the editor without going from a list of posts?

comment:2 in reply to: ↑ 1 5ubliminal3 years ago

Replying to nacin:

There is currently no way to disable edit.php and keep post.php however, you'd have to do that using hooks and a manual wp_die() as appropriate. How would you access the editor without going from a list of posts?

Having a add_menu_page listing my custom post types using query_posts() or directly from the database...? And using get_edit_post_link() to get the edit link plus overriding user_has_cap() to disable deletion possibility and only allow to delete from my own management screen keeping things in order...

comment:3 follow-up: jane3 years ago

  • Keywords needs-patch added

comment:4 in reply to: ↑ 3 5ubliminal3 years ago

Replying to jane:

Just don't block access to post.php if show_ui is false. Patch it to show #inner-sidebar in post.php no matter what the show_ui says.

Would be better to add a new argument (in register_post_type) to block access to post.php editing of a custom post if someone wants that (but it can be done on a case by case basis).

The Submit box may be replicated if missing but the entire sidebar hidden is a loss of space for small metaboxes and hacking it hard makes updating a PITA.

comment:5 nacin3 years ago

  • Milestone changed from 3.1 to Future Release

comment:6 nerrad9 months ago

  • Keywords close added; needs-patch removed

I just tested this on trunk and can't reproduce so pretty sure this ticket is now invalid.

comment:7 helen9 months ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

Also could no longer reproduce.

Note: See TracTickets for help on using tickets.