If link name not given, use url for name. Props Denis-de-Bernardy. fixes #7789 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@10414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-01-22 22:47:34 +00:00
parent 48f9d53e41
commit 576f4098d4

View File

@ -142,8 +142,13 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
if ( !empty( $link_id ) )
$update = true;
if ( trim( $link_name ) == '' )
return 0;
if ( trim( $link_name ) == '' ) {
if ( trim( $link_url ) != '' ) {
$link_name = $link_url;
} else {
return 0;
}
}
if ( trim( $link_url ) == '' )
return 0;