WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im wanting to show a profile/logo pic on author.php via a simple shortcode:

function wpaluploader_showauthorimage() {
$wpaluploader_authorlogo = '<img src="' . get_bloginfo('url'). '/wp-content/uploads/wpal_logos/'.$curauth->ID.''.get_option(wpal_mime) .'"/>';
return $wpaluploader_authorlogo;

I know i need to get:
inside this function, however no matter how i go around it i can get it to work, i have a similar shortcode for all other posts/pages which doesnt need the global and $author declarations as they use the wp loop to get the info.

The plugin im working on takes an uploaded image from frontend, renames it to user_id and pops it in a folder, so its pretty important that i can pull this curauth->ID info to display it on author.php via the shortcode

edit, complete working code:

function wpaluploader_showauthorimage() {
global $author, $profileuser;
if(isset($_GET['author_name'])) {
$curauth = get_userdatabylogin(get_the_author_login());
} else {
$curauth = get_userdata(intval($author));
$wpaluploader_authorlogo = '<img src="' . get_bloginfo('url'). '/wp-content/uploads/wpal_logos/'.$curauth->ID .''.get_option(wpal_mime) .'" />';
return $wpaluploader_authorlogo;
share|improve this question
/wp-admin/user-edit.php starting on line 99. Just check the hooks and filters there and how $profileuser get's called. Pay attention on the switch. Code is written for ... don't know for what exactly, but definitely against readability. – kaiser Jun 8 '11 at 8:47
Ty very much Kaiser, tis done, can you put your comment down as an answer and i will mark it as "answered" regards Martin – MartinJJ Jun 8 '11 at 11:21
up vote 1 down vote accepted

/wp-admin/user-edit.php starting on line 99.

Just check the hooks and filters there and how $profileuser get's called.

(Pay attention on the switch.) :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.