[wp-trac] [WordPress Trac] #49644: Move logic from register_post_type() into WP_Post_Type->register()

WordPress Trac noreply at wordpress.org
Fri Mar 13 16:47:47 UTC 2020


#49644: Move logic from register_post_type() into WP_Post_Type->register()
------------------------------------+------------------------------
 Reporter:  MikeSchinkel            |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Posts, Post Types       |     Version:  5.4
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------------------

Comment (by MikeSchinkel):

 Replying to [comment:1 ocean90]:
 > Just noting that class constructors cannot return a custom value thus
 the `WP_Error` object for a failed validation won't be returned.

 Good point. I shouldn't have rushed to get this pushed up before a
 conference call. :-)

 Hopefully you agree the constructor should validate the post type length,
 right?

 Do you think assigning to an `error` property be a workable solution?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49644#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list