[wp-trac] [WordPress Trac] #14827: Clean Up Updated Messages and UI for custom post types

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 9 06:25:08 UTC 2010


#14827: Clean Up Updated Messages and UI for custom post types
--------------------------+-------------------------------------------------
 Reporter:  johnkolbert   |        Owner:          
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:  3.1     
Component:  Post Types    |      Version:  3.0.1   
 Severity:  normal        |   Resolution:          
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------

Old description:

> I have two concerns with the post editor for custom post types. First,
> WordPress has built in generic notification messages when a post type is
> updated, saved as draft, etc. The only built in support is for posts and
> pages.
>
> Custom post types must filter their own messages through
> 'post_updated_messages' filter independently. I propose a pre-built
> solution that automatically supports these custom update messages. Labels
> will be pulled from the $labels array defined when registering the custom
> post type. No new labels are needed, the existing ones are fine. My
> solution also adds a new filter {$post_type}_updated_messages, where
> developers can modify these generated messages as before if needed.
>
> Secondly, custom post types listed as 'public' => false, and 'show_ui' =>
> true are still shown "View Post", "Preview", and permalink editing boxes
> that all lead to a 404 error message. I propose checking if public is
> true before displaying these items.
>
> I've attached a diff with these modifications. Feed back?

New description:

 {{{

 }}}
 I have two concerns with the post editor for custom post types. First,
 WordPress has built in generic notification messages when a post type is
 updated, saved as draft, etc. The only built in support is for posts and
 pages.

 Custom post types must filter their own messages through
 'post_updated_messages' filter independently. I propose a pre-built
 solution that automatically supports these custom update messages. Labels
 will be pulled from the $labels array defined when registering the custom
 post type. No new labels are needed, the existing ones are fine. My
 solution also adds a new filter {$post_type}_updated_messages, where
 developers can modify these generated messages as before if needed.

 Secondly, custom post types listed as 'public' => false, and 'show_ui' =>
 true are still shown "View Post", "Preview", and permalink editing boxes
 that all lead to a 404 error message. I propose checking if public is true
 before displaying these items.

 I've attached a diff with these modifications. Feed back?

--

Comment(by nacin):

 A random style note, `if ( public == true )` can simply be written as `if
 ( public )`. Otherwise, looks good.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14827#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list