Skip to content

Commit

Permalink
Added an error if name is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2113 committed Jun 19, 2011
1 parent a9194f5 commit 61cb293
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions social_media_shortcode_plugin.php
Expand Up @@ -52,6 +52,10 @@ function smsc_shortcode_handler( $atts, $enclosed, $shortcode ) {
$link = $smsc_shortcodes[$shortcode][1];

if ( empty($text) ) $text = "$name ($service)";

return "<a href=\"$link/$name\" title=\"$name's $service profile\">$text</a>";

if( empty($name) ) {
return "You forgot a username for the website";
} else {
return "<a href=\"$link/$name\" title=\"$name's $service profile\">$text</a>";
}
}

0 comments on commit 61cb293

Please sign in to comment.