Create widget id from widget name when id not specified.

git-svn-id: http://svn.automattic.com/wordpress/trunk@5338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-04-28 06:08:27 +00:00
parent a59fcf3c3a
commit 72f35d050c

View File

@ -81,7 +81,7 @@ function register_sidebar_widget($name, $output_callback, $classname = '', $id =
}
// Last resort -- this can be broken when names get translated so please provide a unique id.
if ( !isset($id) )
if ( empty($id) )
$id = sanitize_title($name);
if ( (!isset($classname) || empty($classname) || !is_string($classname)) && is_string($output_callback) )
@ -122,7 +122,7 @@ function register_widget_control($name, $control_callback, $width = 300, $height
$name = $name[0];
}
if ( !isset($id) || empty($id) )
if ( empty($id) )
$id = $name;
$id = sanitize_title($id);