-if ( empty($wp_registered_sidebars) ) {
- // the theme has no sidebars, die.
- require_once( './admin-header.php' );
-?>
-
- <div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php echo esc_html( $title ); ?></h2>
- <div class="error">
- <p><?php _e( 'No Sidebars Defined' ); ?></p>
- </div>
- <p><?php _e( 'The theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ); ?></p>
- </div>
-
-<?php
- require_once( './admin-footer.php' );
- exit;
+if ( ! current_theme_supports( 'widgets' ) ) {
+ wp_die( __( 'The theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );