Added use of $post

Added use of WordPress global variable $post. Set as function input,
and declared global inside function.
Use $post for setting post ID
Use $post to retrieve post author ID