WordPress.org

Make WordPress Core

Changeset 11308


Ignore:
Timestamp:
05/12/2009 05:56:04 PM (12 years ago)
Author:
azaozz
Message:

Lowercase widgets $id_base, props Denis-de-Bernardy, fixes #9797

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r11229 r11308  
    8080    /**
    8181     * PHP5 constructor
    82      *   widget_options: passed to wp_register_sidebar_widget()
    83      *   - description
     82     *
     83     * @param string $id_base Optional Base ID for the widget, lower case,
     84     * if left empty a portion of the widget's class name will be used. Has to be unique.
     85     * @param string $name Name for the widget displayed on the configuration page.
     86     * @param array $widget_options Optional Passed to wp_register_sidebar_widget()
     87     *   - description: shown on the configuration page
    8488     *   - classname
    85      *   control_options: passed to wp_register_widget_control()
    86      *   - width
    87      *   - height
     89     * @param array $control_options Optional Passed to wp_register_widget_control()
     90     *   - width: required if more than 250px
     91     *   - height: currently not used but may be needed in the future
    8892     */
    8993    function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
    90         $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : $id_base;
     94        $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
    9195        $this->name = $name;
    9296        $this->option_name = 'widget_' . $this->id_base;
     
    9599    }
    96100
    97     /** Constructs name attributes for use in form() fields
     101    /**
     102     * Constructs name attributes for use in form() fields
    98103     *
    99104     * This function should be used in form() methods to create name attributes for fields to be saved by update()
     
    106111    }
    107112
    108     /** Constructs id attributes for use in form() fields
     113    /**
     114     * Constructs id attributes for use in form() fields
    109115     *
    110116     * This function should be used in form() methods to create id attributes for fields to be saved by update()
Note: See TracChangeset for help on using the changeset viewer.