本文整理汇总了PHP中ITSEC_Core::doing_data_upgrade方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Core::doing_data_upgrade方法的具体用法?PHP ITSEC_Core::doing_data_upgrade怎么用?PHP ITSEC_Core::doing_data_upgrade使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITSEC_Core
的用法示例。
在下文中一共展示了ITSEC_Core::doing_data_upgrade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_new_login_url
private function send_new_login_url($url)
{
if (ITSEC_Core::doing_data_upgrade()) {
// Do not send emails when upgrading data. This prevents spamming users with notifications just because the
// data was ported from an old version to a new version.
return;
}
$message = '<p>' . __('Dear Site Admin,', 'better-wp-security') . "</p>\n";
/* translators: 1: Site name, 2: Site address, 3: New login address */
$message .= '<p>' . sprintf(__('The login address for %1$s (<code>%2$s</code>) has changed. The new login address is <code>%3$s</code>. You will be unable to use the old login address.', 'better-wp-security'), get_bloginfo('name'), esc_url(get_site_url()), esc_url($url)) . "</p>\n";
if (defined('ITSEC_DEBUG') && ITSEC_DEBUG === true) {
$message .= '<p>Debug info (source page): ' . esc_url($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]) . "</p>\n";
}
$message = "<html>\n{$message}</html>\n";
//Setup the remainder of the email
$recipients = ITSEC_Modules::get_setting('global', 'notification_email');
$subject = sprintf(__('[%1$s] WordPress Login Address Changed', 'better-wp-security'), get_site_url());
$subject = apply_filters('itsec_lockout_email_subject', $subject);
$headers = 'From: ' . get_bloginfo('name') . ' <' . get_option('admin_email') . '>' . "\r\n";
//Use HTML Content type
add_filter('wp_mail_content_type', array($this, 'get_html_content_type'));
//Send emails to all recipients
foreach ($recipients as $recipient) {
$recipient = trim($recipient);
if (is_email($recipient)) {
wp_mail($recipient, $subject, $message, $headers);
}
}
//Remove HTML Content type
remove_filter('wp_mail_content_type', array($this, 'get_html_content_type'));
}