Originally from http://wp-snippets.com/hide-toolbar-when-theres-an-error/