Skip to content

Instantly share code, notes, and snippets.

@ryanfitton
Last active December 31, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanfitton/7965119 to your computer and use it in GitHub Desktop.
Save ryanfitton/7965119 to your computer and use it in GitHub Desktop.
Get a users Bio Description whose email address is the same for what is set in WordPress' Administration within General Settings
<p><?php echo wpAdminEmailUserBio(); ?></p>
<?php
//Get the Bio of the user whose email address is used for Admin Purposes in 'General Settings'
function wpAdminEmailUserBio() {
//Find the standard user whose email address is the same as WordPress' general settings administration email address
$findUser = get_user_by('email', get_bloginfo('admin_email'));
//Check if a user could be found
if ($findUser) {
//If true then get the Bio from the persons User ID and store it to a variable
$bio = get_the_author_meta('description', $findUser->id);
} else {
//If false then set an error message to a variable
$bio = "No user could be found whose email address matches the admin email address set within WordPress General Settings";
}
//Return results when function is called
return $bio;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment