Código de trabajo:
function author_id_shortcode(){
ob_start();
// We get the author ID outside loop.
global $post;
$author_id = $post->post_author;
// Now get the author ID inside loop.
$author_id = get_the_author_meta( 'ID' );
$output = get_the_author_meta( 'ID', $author_id );
ob_end_clean();
return $output;
}
add_shortcode( 'author_id', 'author_id_shortcode' );
llamar al shortcode con [author_id]
.