Make WordPress Core

Changeset 11045


Ignore:
Timestamp:
04/22/2009 04:01:20 AM (17 years ago)
Author:
azaozz
Message:

Optionally use the class name as id_base, see #9511

File:
1 edited

Legend:

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

    r11030 r11045  
    7474         * PHP4 constructor
    7575         */
    76         function WP_Widget( $id_base, $name, $widget_options = array(), $control_options = array() ) {
     76        function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
    7777                $this->__construct( $id_base, $name, $widget_options, $control_options );
    7878        }
    … …  
    8787         *       - height
    8888         */
    89         function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
    90                 $this->id_base = $id_base;
    91         //      $this->id_base = str_replace( 'wp_widget_', '', strtolower(get_class($this)) );
     89        function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
     90                $this->id_base = $id_base === false ? str_replace( 'wp_widget_', '', strtolower(get_class($this)) ) : $id_base;
    9291                $this->name = $name;
    9392                $this->option_name = 'widget_' . $id_base;
Note: See TracChangeset for help on using the changeset viewer.