Adding jQuery check for publishing and unpublishing.