WordPress.org

Make WordPress Core

Ticket #36212: 36212.4.diff

File 36212.4.diff, 654 bytes (added by maxpertici, 12 months ago)

Keep blank label with a non-breaking space

  • src/wp-admin/includes/nav-menu.php

    diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php
    index 42d3607d23..d26914e3fc 100644
    a b function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selecte 
    11811181                foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
    11821182
    11831183                        // Menu item title can't be blank.
     1184                        // Keep it with a non-breaking space
    11841185                        if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' === $_POST['menu-item-title'][ $_key ] ) {
    1185                                 continue;
     1186                                $_POST['menu-item-title'][ $_key ] = ' ';
    11861187                        }
    11871188
    11881189                        $args = array();