[wp-trac] [WordPress Trac] #41980: show_in_menu doesn't work with int value

WordPress Trac noreply at wordpress.org
Thu Sep 4 13:42:26 UTC 2025


#41980: show_in_menu doesn't work with int value
-------------------------------+-----------------------------
 Reporter:  truongwp           |       Owner:  (none)
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.9
 Severity:  normal             |  Resolution:  invalid
 Keywords:  has-patch          |     Focuses:  administration
-------------------------------+-----------------------------
Changes (by SirLouen):

 * status:  new => closed
 * type:  defect (bug) => enhancement
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 [https://developer.wordpress.org/reference/functions/register_post_type/#parameters
 According to the docs], `show_in_menu` only accepts `bool` or `string`.
 `int` values are not accepted and I can't see a reason of why they should
 be accepted.

 If you can provide an use case on where switch to `int` could be valuable,
 maybe this could be reconsidered, but just asking to change for the sake
 of changing it its not a great idea.

 I'm closing this as `invalid`. Feel free to reopen it, if you happen to
 have a use case to better showcase the need of this improvement

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


More information about the wp-trac mailing list