get_the_author_meta( ‘ID’ ) just return 1


I’ve a custom post type, and I want to get the author ID inside a condition in my function.php, and it just return 1 – as I can see with var_dump and print_r. If I use the same function directly inside the single-teste.php, it return the author ID. But in this function, just zero. I’ve tried all the ways to get the Author Id inside this function, but nothing works. The “substract” function is working normally.

function example_ajax_request() {     if ( isset($  _REQUEST) ) {         $  fruit = $  _REQUEST['fruit'];         if ( $  fruit == 'Banana' ) {            $  user_id = get_current_user_id();           $  disponivel = mycred_get_users_balance($  user_id);           $  author_id = get_the_author_meta('ID');           while(isset($  disponivel) && $  disponivel >= 0){             $  descontou = mycred_subtract( 'penalty', $  user_id, -10, 'Tipo de Compra');             $  pay_modelo = mycred_add('approved_comment', $  author_id, 10, 'Teste');             return $  descontou;             return $  pay_modelo;           }          }     }    wp_die(); } add_action( 'wp_ajax_example_ajax_request', 'example_ajax_request' ); add_action( 'wp_ajax_nopriv_example_ajax_request', 'example_ajax_request' ); 

I call this function via ajax. I’ve no idea what can be the reason of it. Maybe someone has an idea?