]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/widgets.php
WordPress 4.3.1
[autoinstalls/wordpress.git] / wp-admin / includes / widgets.php
index 0a868151e06d53d85132a3a3e654c8c6e6c43f9d..36cf6449a8cc0ca76303d3276af9a1b57b6308f1 100644 (file)
  * Display list of the available widgets.
  *
  * @since 2.5.0
+ *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
  */
 function wp_list_widgets() {
-       global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
+       global $wp_registered_widgets, $wp_registered_widget_controls;
 
        $sort = $wp_registered_widgets;
        usort( $sort, '_sort_name_callback' );
@@ -51,6 +54,8 @@ function wp_list_widgets() {
  *
  * @since 3.1.0
  * @access private
+ *
+ * @return int
  */
 function _sort_name_callback( $a, $b ) {
        return strnatcasecmp( $a['name'], $b['name'] );
@@ -99,6 +104,10 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
  *
  * @since 2.5.0
  *
+ * @global array $wp_registered_widgets
+ *
+ * @staticvar int $i
+ *
  * @param array $params
  * @return array
  */
@@ -123,7 +132,14 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) {
        return $params;
 }
 
-function next_widget_id_number($id_base) {
+/**
+ *
+ * @global array $wp_registered_widgets
+ *
+ * @param string $id_base
+ * @return int
+ */
+function next_widget_id_number( $id_base ) {
        global $wp_registered_widgets;
        $number = 1;
 
@@ -143,6 +159,10 @@ function next_widget_id_number($id_base) {
  *
  * @since 2.5.0
  *
+ * @global array $wp_registered_widgets
+ * @global array $wp_registered_widget_controls
+ * @global array $sidebars_widgets
+ *
  * @param array $sidebar_args
  * @return array
  */
@@ -173,11 +193,14 @@ function wp_widget_control( $sidebar_args ) {
                $query_arg['key'] = $key;
        }
 
-       // We aren't showing a widget control, we're outputting a template for a multi-widget control
+       /*
+        * We aren't showing a widget control, we're outputting a template
+        * for a multi-widget control.
+        */
        if ( isset($sidebar_args['_display']) && 'template' == $sidebar_args['_display'] && $widget_number ) {
                // number == -1 implies a template where id numbers are replaced by a generic '__i__'
                $control['params'][0]['number'] = -1;
-               // with id_base widget id's are constructed like {$id_base}-{$id_number}
+               // With id_base widget id's are constructed like {$id_base}-{$id_number}.
                if ( isset($control['id_base']) )
                        $id_format = $control['id_base'] . '-__i__';
        }
@@ -202,7 +225,7 @@ function wp_widget_control( $sidebar_args ) {
        </div>
 
        <div class="widget-inside">
-       <form action="" method="post">
+       <form method="post">
        <div class="widget-content">
 <?php
        if ( isset($control['callback']) )