WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/25/2009 12:43:51 PM (13 years ago)
Author:
azaozz
Message:

Move recent posts widget to WP_Widget. see #8441

File:
1 edited

Legend:

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

    r11074 r11087  
    8888     */
    8989    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;
     90        $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : $id_base;
    9191        $this->name = $name;
    92         $this->option_name = 'widget_' . $id_base;
     92        $this->option_name = 'widget_' . $this->id_base;
    9393        $this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) );
    9494        $this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) );
Note: See TracChangeset for help on using the changeset viewer.