I used in_array() here instead of a direct comparison, because
the actual match
depends on your permalink structure.
It would be name for /%postname%/, category_name for /%category%/%postname%/, pagename for /%year%/%monthnum%/%postname%/, etc.