WordPress.org

Ready to get started?Download WordPress

Forums

Use get_userdata() from inside an Ajax-called function (1 post)

  1. yannlossouarn
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic