Forums

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

  1. yannlossouarn
    Member
    Posted 6 months 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

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 6 months ago by yannlossouarn
  • This topic is not resolved
  • WordPress version: 3.2.1