Support » Plugins and Hacks » Hacks » Use get_userdata() from inside an Ajax-called function

  • Hi !

    I try launching a function from WordPress core from a function that is triggered through Ajax and it seems the core function is not available. Here’s an extract of my code. Any idea ?

    add_action( 'wp_ajax_ajax_action', 'getPositionDetails' );
    add_action( 'wp_ajax_nopriv_ajax_action', 'getPositionDetails' );
    
    function getPositionDetails() {
    // .....
    	foreach( $membersHere as $member ) {
    		get_userdata($member->user_id)
    	}
    // .....
    }

    Thanks ! 🙂
    Yann

  • The topic ‘Use get_userdata() from inside an Ajax-called function’ is closed to new replies.