Expanded comment

Expanded explanation
Added global declaration

Added global declaration for $pagenow
Removed $post_id

Removed variable $post_id as it is unnecessary