Skip to content

Commit 36bef7f

Browse files
authored
Merge pull request #964 from siteorigin/sidebar-emulator-account-for-potential-notice
Sidebar Emulator: Account for potential notice when setting widget id
2 parents d18aa07 + 1d4c0de commit 36bef7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inc/sidebars-emulator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function __call( $name, $args ) {
5050
if ( $instance_class == $widget_class && ! empty( $sidebar_id ) ) {
5151
//The option value uses only the widget id number as keys
5252
preg_match( '/-([0-9]+$)/', $sidebar_id, $num_match );
53-
$args[0][ $num_match[1] ] = $widget_instance;
53+
if ( ! empty( $num_match ) ) {
54+
$args[0][ $num_match[1] ] = $widget_instance;
55+
}
5456
}
5557
}
5658
}

0 commit comments

Comments
 (0)