widgets.php (1086B)
1 <?php 2 /** 3 * Widget administration screen. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** WordPress Administration Bootstrap */ 10 require_once __DIR__ . '/admin.php'; 11 12 /** WordPress Administration Widgets API */ 13 require_once ABSPATH . 'wp-admin/includes/widgets.php'; 14 15 if ( ! current_user_can( 'edit_theme_options' ) ) { 16 wp_die( 17 '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . 18 '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', 19 403 20 ); 21 } 22 23 if ( ! current_theme_supports( 'widgets' ) ) { 24 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="https://developer.wordpress.org/themes/functionality/widgets/">follow these instructions</a>.' ) ); 25 } 26 27 $title = __( 'Widgets' ); 28 $parent_file = 'themes.php'; 29 30 if ( wp_use_widgets_block_editor() ) { 31 require ABSPATH . 'wp-admin/widgets-form-blocks.php'; 32 } else { 33 require ABSPATH . 'wp-admin/widgets-form.php'; 34 }