]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/widgets.php
WordPress 4.2.1-scripts
[autoinstalls/wordpress.git] / wp-admin / widgets.php
index 222251a1bb995c2dc7de09caf814a50862632e22..1e34d81bb016be22536fee2a6586c032dbfdbbf7 100644 (file)
@@ -70,12 +70,12 @@ get_current_screen()->add_help_tab( array(
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>' .
+       '<p>' . __('<a href="https://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>' .
        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
 );
 
 if ( ! current_theme_supports( 'widgets' ) ) {
-       wp_die( __( 'The theme you are currently using isn&#8217;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="http://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );
+       wp_die( __( 'The theme you are currently using isn&#8217;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://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );
 }
 
 // These are the widgets grouped by sidebar
@@ -189,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
@@ -316,7 +316,13 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
        if ( current_user_can( 'customize' ) ) {
                printf(
                        ' <a class="add-new-h2 hide-if-no-customize" href="%1$s">%2$s</a>',
-                       admin_url( 'customize.php?autofocus[panel]=widgets' ),
+                       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' )
                );
        }
@@ -324,7 +330,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
 </h2>
 
 <?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
-<div id="message" class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<div id="message" class="updated notice is-dismissible"><p><?php echo $messages[$_GET['message']]; ?></p></div>
 <?php } ?>
 <?php if ( isset($_GET['error']) && isset($errors[$_GET['error']]) ) { ?>
 <div id="message" class="error"><p><?php echo $errors[$_GET['error']]; ?></p></div>
@@ -428,7 +434,7 @@ foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
 </div>
 </div>
 </div>
-<form action="" method="post">
+<form method="post">
 <?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>
 </form>
 <br class="clear" />