Move recent posts widget to WP_Widget. see #8441

git-svn-id: https://develop.svn.wordpress.org/trunk@11087 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-04-25 12:43:51 +00:00
parent d812bc92a8
commit 1ad72b3d59
2 changed files with 67 additions and 72 deletions
+2 -2
View File
@@ -87,9 +87,9 @@ class WP_Widget {
* - height
*/
function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
$this->id_base = $id_base === false ? str_replace( 'wp_widget_', '', strtolower(get_class($this)) ) : $id_base;
$this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : $id_base;
$this->name = $name;
$this->option_name = 'widget_' . $id_base;
$this->option_name = 'widget_' . $this->id_base;
$this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) );
$this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) );
}