Create widget id from widget name when id not specified.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-04-28 06:08:45 +00:00
parent f59d101bd8
commit 4bbdc94490
1 changed files with 2 additions and 2 deletions

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);