[wp-trac] [WordPress Trac] #58361: Passing 'none' as 'menu_icon' to 'register_post_type' is not working correctly

WordPress Trac noreply at wordpress.org
Sat May 20 00:55:39 UTC 2023


#58361: Passing 'none' as 'menu_icon' to 'register_post_type' is not working
correctly
----------------------------+-----------------------------
 Reporter:  andrewleap      |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  6.2.1
 Severity:  minor           |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 The resultant menu item contains:

 {{{
 <img src="http://none" alt="">
 }}}

 This is presumably because


 {{{
 $menu_icon = esc_url( $ptype_obj->menu_icon );
 }}}

 was wrapped in `esc_url` in wp-admin/menu.php at some point, so it can no
 longer be correctly compared in wp-admin/menu-header.php with

 {{{
  'none' === $item[6] || 'div' === $item[6]
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58361>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list