2

I am trying to query a working WP install for user info to be used with an api. When I place the code below in the "text" portion of the new page editor the page displays normally except the area of the page containing the code remains blank and does not echo out anything at all.

If I view the source of the page I see the php wrapped in a

tag, but again it does not render as HTML in my browser(s). I've installed the ".PHP on pages" plugin which adds the .php file extension to all pages, but that has made no noticeable change. I copied this code directly from WP codex so it's probably something simple I'm overlooking.

<?php global $display_name , $user_email;
  get_currentuserinfo();

  echo $display_name . "'s email address is: " . $user_email;
?>

Thanks.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399

1 Answers1

0

That function has been deprecated. You should use wp_get_current_user() instead.

brasofilo
  • 25,496
  • 15
  • 91
  • 179
Liam's musings
  • 167
  • 4
  • 9