diff --git a/wp-includes/version.php b/wp-includes/version.php index 93683a7cbd..102462051f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41326'; +$wp_version = '4.9-alpha-41327'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index fbbdcf5f55..3b4944023c 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1036,6 +1036,11 @@ function wp_convert_widget_settings($base_name, $option_name, $settings) { function the_widget( $widget, $instance = array(), $args = array() ) { global $wp_widget_factory; + if ( ! isset( $wp_widget_factory->widgets[ $widget ] ) ) { + _doing_it_wrong( __FUNCTION__, __( 'Widgets need to be registered before they can be displayed.' ), '4.9.0' ); + return; + } + $widget_obj = $wp_widget_factory->widgets[$widget]; if ( ! ( $widget_obj instanceof WP_Widget ) ) { return;