WordPress.org

Make WordPress Core

Ticket #45361: 45361.4.diff

File 45361.4.diff, 606 bytes (added by audrasjb, 7 months ago)

Fix issue with sprintf function in the previous patch

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

    diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php
    index 68a9e09..a565f3a 100644
    a b function register_nav_menus( $locations = array() ) { 
    9292
    9393        add_theme_support( 'menus' );
    9494
     95        foreach ( $locations as $key => $value ) {
     96                if ( is_int( $key ) ) {
     97                        $message = __( 'Strings should always be used for menu location slugs.' );
     98                        _doing_it_wrong( __FUNCTION__, $message, '5.3' );
     99                        break;
     100                }
     101        }
     102
    95103        $_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );
    96104}
    97105