Skip to content

Instantly share code, notes, and snippets.

@dbarkley
Created March 10, 2014 19:16
Show Gist options
  • Save dbarkley/9472247 to your computer and use it in GitHub Desktop.
Save dbarkley/9472247 to your computer and use it in GitHub Desktop.
<?php
$seller_name = "website";
$text_field_name = "text12";
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
$roles = $current_user->roles;
if (in_array("seller", $roles)) {
$seller_name = "$current_user->user_login";
}
}
$html .= "<input type=\"hidden\" value=\"$seller_name\" name=\"$text_field_name\"/>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment