[wp-trac] [WordPress Trac] #45733: Identical nav menu labels prevent Customizer from loading

WordPress Trac noreply at wordpress.org
Sat Dec 22 19:39:06 UTC 2018


#45733: Identical nav menu labels prevent Customizer from loading
-------------------------------+------------------------------
 Reporter:  brianburton        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  4.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by dlh):

 * keywords:   => reporter-feedback
 * version:  5.0.2 => 4.3


Comment:

 Hi @brianburton,

 > 2. Have wp_create_nav_menu() return an instance of WP_Error if it is
 called with an existing label (preferred).

 `wp_create_nav_menu()` does return a `WP_Error`:
 https://github.com/WordPress/wordpress-
 develop/blob/29cb0f5ad52863494634229532d0a1bbf9993f45/src/wp-includes/nav-
 menu.php#L234-L247

 As I understand the code sample, the `WP_Error` is then saved as the theme
 mod, which is not intended.

 In addition to @joyously's comments, could the code check the return value
 before saving the theme mod?

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


More information about the wp-trac mailing list