'Contributor', 'wp-mail-logging'); case 'Subscriber': return __('Subscriber', 'wp-mail-logging'); case 'Anyone': return __('Anyone', 'wp-mail-logging'); } return $optionValue; } /** * Query MySQL DB for its version * @return string|false */ protected function getMySqlVersion() { global $wpdb; $rows = $wpdb->get_results('select version() as mysqlversion'); if (!empty($rows)) { return $rows[0]->mysqlversion; } return false; } /** * If you want to generate an email address like "no-reply@your-site.com" then * you can use this to get the domain name part. * E.g. 'no-reply@' . $this->getEmailDomain(); * This code was stolen from the wp_mail function, where it generates a default * from "wordpress@your-site.com" * @return string domain name */ public function getEmailDomain() { // Get the site domain and get rid of www. $sitename = strtolower($_SERVER['SERVER_NAME']); if (substr($sitename, 0, 4) == 'www.') { $sitename = substr($sitename, 4); } return $sitename; } }