mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 01:57:53 +01:00
81f62198c3
Moves the widgets block editor from Gutenberg into WordPress Core. - Adds @wordpress/edit-widgets, @wordpress/customize-widgets and @wordpress/widgets. - Modifies wp-admin/widgets.php to branch between the old editor and new editor depending on wp_use_widgets_block_editor(). - Modifies WP_Customize_Widgets to branch between the old editor control and new editor control depending on wp_use_widgets_block_editor(). Fixes #51506. Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp. Built from https://develop.svn.wordpress.org/trunk@50996 git-svn-id: http://core.svn.wordpress.org/trunk@50605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
31 lines
734 B
PHP
31 lines
734 B
PHP
<?php
|
|
/**
|
|
* Widget administration screen.
|
|
*
|
|
* @package WordPress
|
|
* @subpackage Administration
|
|
*/
|
|
|
|
/** WordPress Administration Bootstrap */
|
|
require_once __DIR__ . '/admin.php';
|
|
|
|
/** WordPress Administration Widgets API */
|
|
require_once ABSPATH . 'wp-admin/includes/widgets.php';
|
|
|
|
if ( ! current_user_can( 'edit_theme_options' ) ) {
|
|
wp_die(
|
|
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
|
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
|
|
403
|
|
);
|
|
}
|
|
|
|
$title = __( 'Widgets' );
|
|
$parent_file = 'themes.php';
|
|
|
|
if ( wp_use_widgets_block_editor() ) {
|
|
require ABSPATH . 'wp-admin/widgets-form-blocks.php';
|
|
} else {
|
|
require ABSPATH . 'wp-admin/widgets-form.php';
|
|
}
|