WordPress.org

Make WordPress Core

Ticket #19709: 19709.4.diff

File 19709.4.diff, 580 bytes (added by audrasjb, 13 months ago)

Avoid generating the same ID in two HTML elements as per Helen’s comment

  • src/wp-includes/widgets.php

    diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
    index db06222a51..5dececaaeb 100644
    a b function dynamic_sidebar( $index = 1 ) { 
    704704
    705705        $sidebar = $wp_registered_sidebars[ $index ];
    706706
    707         $sidebar['before_sidebar'] = sprintf( $sidebar['before_sidebar'], $sidebar['id'], $sidebar['class'] );
     707        $sidebar['before_sidebar'] = sprintf( $sidebar['before_sidebar'], 'sidebar-' . $sidebar['id'], $sidebar['class'] );
    708708
    709709        /**
    710710         * Fires before widgets are rendered in a dynamic sidebar.