get_user_by slug isn't working
-
This is the code I have and get_user_by seems to be returning an empty object
global $this_player; $player_name = strtolower(str_replace(" ","",trim(str_replace(range(0,9),'',get_the_title($id))))); $this_player = get_user_by('slug', $player_name); if ( !$this_player ) die('No valid user found!');
Now I can’t past the if statement, however if I manually replace $player_name with ‘nicename’ then it works, I have confirmed that $player_name is holding nicename so I am a little confused.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_user_by slug isn't working’ is closed to new replies.