2007-04-24 01:05:17 +00:00
< ? php
2008-08-16 07:27:34 +00:00
/**
2021-05-25 08:40:25 +00:00
* Widget administration screen .
2008-08-16 07:27:34 +00:00
*
* @ package WordPress
* @ subpackage Administration
*/
2007-04-24 01:05:17 +00:00
2008-08-16 07:27:34 +00:00
/** WordPress Administration Bootstrap */
2020-02-06 06:33:11 +00:00
require_once __DIR__ . '/admin.php' ;
2008-08-16 07:27:34 +00:00
/** WordPress Administration Widgets API */
2020-02-06 06:33:11 +00:00
require_once ABSPATH . 'wp-admin/includes/widgets.php' ;
2007-04-24 01:05:17 +00:00
2015-09-03 08:56:24 +00:00
if ( ! current_user_can ( 'edit_theme_options' ) ) {
wp_die (
2018-02-19 02:13:32 +00:00
'<h1>' . __ ( 'You need a higher level of permission.' ) . '</h1>' .
2016-06-29 15:16:29 +00:00
'<p>' . __ ( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>' ,
2015-09-03 08:56:24 +00:00
403
);
}
2007-05-04 17:52:22 +00:00
2021-06-02 01:57:57 +00:00
if ( ! current_theme_supports ( 'widgets' ) ) {
2022-03-22 19:59:04 +00:00
wp_die ( __ ( 'The theme you are currently using is not 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>.' ) );
2021-06-02 01:57:57 +00:00
}
2021-07-22 13:53:00 +00:00
// Used in the HTML title tag.
2017-11-30 23:11:00 +00:00
$title = __ ( 'Widgets' );
2008-01-04 23:34:33 +00:00
$parent_file = 'themes.php' ;
2007-06-14 02:25:30 +00:00
2021-05-25 08:40:25 +00:00
if ( wp_use_widgets_block_editor () ) {
require ABSPATH . 'wp-admin/widgets-form-blocks.php' ;
2013-11-20 05:09:10 +00:00
} else {
2021-05-25 08:40:25 +00:00
require ABSPATH . 'wp-admin/widgets-form.php' ;
2013-11-20 04:45:10 +00:00
}