- Call wp_set_current_user() so that other WP functions that depend on the current user work correctly. (custom taxonomy)
- Only do image template processing if the preferred text type is plain
- Removed http_response_code() call since it is only supported by PHP 5.4 or newer.