diff --git a/wp-includes/class-wp-widget.php b/wp-includes/class-wp-widget.php index 8d1de7c375..b177c82053 100644 --- a/wp-includes/class-wp-widget.php +++ b/wp-includes/class-wp-widget.php @@ -160,7 +160,14 @@ class WP_Widget { * information on accepted arguments. Default empty array. */ public function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) { - $this->id_base = empty( $id_base ) ? preg_replace( '/(wp_)?widget_/', '', strtolower( get_class( $this ) ) ) : strtolower( $id_base ); + if ( ! empty( $id_base ) ) { + $id_base = strtolower( $id_base ); + } else { + $id_base = preg_replace( '/(wp_)?widget_/', '', strtolower( get_class( $this ) ) ); + $id_base = str_replace( '\\', '-', $id_base ); + } + + $this->id_base = $id_base; $this->name = $name; $this->option_name = 'widget_' . $this->id_base; $this->widget_options = wp_parse_args( diff --git a/wp-includes/version.php b/wp-includes/version.php index 935cfe79c7..66722db6da 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50952'; +$wp_version = '5.8-alpha-50953'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.