]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/widgets.php
WordPress 4.1.3-scripts
[autoinstalls/wordpress.git] / wp-admin / widgets.php
index 8dc99bd3650cd2371e7ecd2bef842fff7c52f859..222251a1bb995c2dc7de09caf814a50862632e22 100644 (file)
@@ -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') )
 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']) ) {
 
 $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
  */
  *
  * @since 2.2.0
  */
@@ -70,7 +71,7 @@ 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>' .
 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="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
 );
 
 if ( ! current_theme_supports( 'widgets' ) ) {
 );
 
 if ( ! current_theme_supports( 'widgets' ) ) {
@@ -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();
 
        $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) ) {
        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;
 
 
        $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) )
        if ( !isset($_POST['delete_widget']) ) {
                foreach ( $sidebars_widgets as $key => $sb ) {
                        if ( is_array($sb) )
@@ -223,7 +224,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
 
        $id_base = isset($control['id_base']) ? $control['id_base'] : $control['id'];
 
 
        $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;
 
        $width = ' style="width:' . max($control['width'], 350) . 'px"';
        $key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
 
@@ -309,7 +310,18 @@ $errors = array(
 require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
 
 <div class="wrap">
 require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
 
 <div class="wrap">
-<h2><?php echo esc_html( $title ); ?></h2>
+<h2>
+<?php
+       echo esc_html( $title );
+       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' ),
+                       __( 'Manage in Customizer' )
+               );
+       }
+?>
+</h2>
 
 <?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
 <div id="message" class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
 
 <?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
 <div id="message" class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>