X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/80b7979fccf09a75af3f4c111fa27060ae6dbf85..85ad385665744d9cc3bcd939906309be7268edb3:/wp-admin/widgets.php diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 9df98fbe..8dc99bd3 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( './admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); /** WordPress Administration Widgets API */ require_once(ABSPATH . 'wp-admin/includes/widgets.php'); @@ -34,6 +34,11 @@ if ( 'on' == $widgets_access ) { wp_enqueue_script( 'jquery-touch-punch' ); } +/** + * Fires early before the Widgets administration screen loads, after scripts are enqueued. + * + * @since 2.2.0 + */ do_action( 'sidebar_admin_setup' ); $title = __( 'Widgets' ); @@ -59,7 +64,7 @@ get_current_screen()->add_help_tab( array( 'title' => __('Missing Widgets'), 'content' => '

' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '

' . - '

' . __('When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive area, where all your widgets and their settings will have been saved.') . '

' + '

' . __('When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.') . '

' ) ); get_current_screen()->set_help_sidebar( @@ -68,23 +73,8 @@ get_current_screen()->set_help_sidebar( '

' . __('Support Forums') . '

' ); -if ( empty($wp_registered_sidebars) ) { - // the theme has no sidebars, die. - require_once( './admin-header.php' ); -?> - -
- -

-
-

-
-

follow these instructions.' ); ?>

-
- -follow these instructions.' ) ); } // These are the widgets grouped by sidebar @@ -197,7 +187,8 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { if ( isset($_GET['addnew']) ) { // Default to the first sidebar - $sidebar = array_shift( $keys = array_keys($wp_registered_sidebars) ); + $keys = array_keys( $wp_registered_sidebars ); + $sidebar = array_shift( $keys ); if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget // Copy minimal info from an existing instance of this widget to a new instance @@ -236,9 +227,8 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { $width = ' style="width:' . max($control['width'], 350) . 'px"'; $key = isset($_GET['key']) ? (int) $_GET['key'] : 0; - require_once( './admin-header.php' ); ?> + require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

>

@@ -303,7 +293,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
+require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

@@ -329,78 +318,102 @@ require_once( './admin-header.php' ); ?>

- +
-
-

-
- + +

-
+
+ +
+ +
+

$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"'; +} + +?>
-
+
> +
@@ -409,6 +422,20 @@ foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
+
+
    +
    + + +
    +
    +