X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fa11948979fd6a4ea5705dc613b239699a459db3..fcaa67f093b5c83deea7a361a8cf8c6ac4e832d3:/wp-admin/widgets.php diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index db2a279f..1e34d81b 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -13,7 +13,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); require_once(ABSPATH . 'wp-admin/includes/widgets.php'); if ( ! current_user_can('edit_theme_options') ) - wp_die( __( 'Cheatin’ uh?' )); + wp_die( __( 'Cheatin’ uh?' ), 403 ); $widgets_access = get_user_setting( 'widgets_access' ); if ( isset($_GET['widgets-access']) ) { @@ -35,7 +35,8 @@ if ( 'on' == $widgets_access ) { } /** - * Fires early before the Widgets administration screen loads, after scripts are enqueued. + * Fires early before the Widgets administration screen loads, + * after scripts are enqueued. * * @since 2.2.0 */ @@ -69,12 +70,12 @@ get_current_screen()->add_help_tab( array( get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Widgets') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Documentation on Widgets') . '

' . + '

' . __('Support Forums') . '

' ); 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 follow these instructions.' ) ); + 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 follow these instructions.' ) ); } // These are the widgets grouped by sidebar @@ -140,7 +141,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) { $id_base = $_POST['id_base']; $sidebar = isset($sidebars_widgets[$sidebar_id]) ? $sidebars_widgets[$sidebar_id] : array(); - // delete + // Delete. if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) { if ( !in_array($widget_id, $sidebar, true) ) { @@ -167,7 +168,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) { $sidebars_widgets[$sidebar_id] = $sidebar; - // remove old position + // Remove old position. if ( !isset($_POST['delete_widget']) ) { foreach ( $sidebars_widgets as $key => $sb ) { if ( is_array($sb) ) @@ -188,7 +189,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { if ( isset($_GET['addnew']) ) { // Default to the first sidebar $keys = array_keys( $wp_registered_sidebars ); - $sidebar = array_shift( $keys ); + $sidebar = reset( $keys ); if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget // Copy minimal info from an existing instance of this widget to a new instance @@ -223,13 +224,12 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { $id_base = isset($control['id_base']) ? $control['id_base'] : $control['id']; - // show the widget form + // Show the widget form. $width = ' style="width:' . max($control['width'], 350) . 'px"'; $key = isset($_GET['key']) ? (int) $_GET['key'] : 0; require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

>

@@ -310,11 +310,27 @@ $errors = array( require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
- -

+

+%2$s', + esc_url( add_query_arg( + array( + array( 'autofocus' => array( 'panel' => 'widgets' ) ), + 'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) + ), + admin_url( 'customize.php' ) + ) ), + __( 'Manage in Customizer' ) + ); + } +?> +

-

+

@@ -332,80 +348,106 @@ do_action( 'widgets_admin_page' ); ?>
-
-

-
- + +

-
+
+ +
+ +
+

$registered_sidebar ) { if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) { $wrap_class = 'widgets-holder-wrap'; if ( !empty( $registered_sidebar['class'] ) ) $wrap_class .= ' ' . $registered_sidebar['class']; -?> - + ?>
-
- +
- +?>
+ 1 ) { + $split = ceil( $sidebars_count / 2 ); +} else { + $single_sidebar_class = ' class="single-sidebar"'; +} + +?>
-
+
> +
-
+
+
+
+
    +
    + + +
    +
    +