2017-08-08 12:06:05 +02:00
< ? php
/**
2021-09-21 15:01:08 +02:00
* Widget administration screen .
2017-08-08 12:06:05 +02:00
*
* @ package WordPress
* @ subpackage Administration
*/
/** WordPress Administration Bootstrap */
2021-09-21 15:01:08 +02:00
require_once __DIR__ . '/admin.php' ;
2017-08-08 12:06:05 +02:00
/** WordPress Administration Widgets API */
2021-09-21 15:01:08 +02:00
require_once ABSPATH . 'wp-admin/includes/widgets.php' ;
2017-08-08 12:06:05 +02:00
if ( ! current_user_can ( 'edit_theme_options' ) ) {
wp_die (
2018-04-16 15:29:38 +02:00
'<h1>' . __ ( 'You need a higher level of permission.' ) . '</h1>' .
2017-08-08 12:06:05 +02:00
'<p>' . __ ( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>' ,
403
);
}
if ( ! current_theme_supports ( 'widgets' ) ) {
2021-09-21 15:01:08 +02:00
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>.' ) );
2017-08-08 12:06:05 +02:00
}
2021-09-21 15:01:08 +02:00
$title = __ ( 'Widgets' );
$parent_file = 'themes.php' ;
2017-08-08 12:06:05 +02:00
2021-09-21 15:01:08 +02:00
if ( wp_use_widgets_block_editor () ) {
require ABSPATH . 'wp-admin/widgets-form-blocks.php' ;
2017-08-08 12:06:05 +02:00
} else {
2021-09-21 15:01:08 +02:00
require ABSPATH . 'wp-admin/widgets-form.php' ;
2017-08-08 12:06:05 +02:00
}