get_the_content()
must be used inside the loop, or otherwise you’ll need to use setup_postdata();
providing the post object.
Try the following:
function ajax_action_stuff() {
$post_id = $_POST['post_id'];
//Query the post and set-up data
$post = get_post($post_id);
setup_postdata( $post );
update_post_meta($post_id, 'post_key', 'meta_value');
//Return response as an array. This will give us data.title and data.content browser-side.
$response = array()
$response['title'] = get_the_title();
$response['content'] = get_the_content();
echo json_encode($response);
exit;
}
This has not been tested