本文整理汇总了PHP中wp_specialchars_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_specialchars_decode函数的具体用法?PHP wp_specialchars_decode怎么用?PHP wp_specialchars_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_specialchars_decode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: send_notification_email
function send_notification_email($to_email, $subject, $message, $reply_to = '', $reply_to_name = '', $plain_text = true, $attachments = array())
{
$content_type = $plain_text ? 'text/plain' : 'text/html';
$reply_to_name = $reply_to_name == '' ? wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) : $reply_to_name;
//senders name
$reply_to = ($reply_to == '' or $reply_to == '[admin_email]') ? get_option('admin_email') : $reply_to;
//senders e-mail address
if ($to_email == '[admin_email]') {
$to_email = get_option('admin_email');
}
$recipient = $to_email;
//recipient
$header = "From: \"{$reply_to_name}\" <{$reply_to}>\r\n Reply-To: \"{$reply_to_name}\" <{$reply_to}>\r\n Content-Type: {$content_type}; charset=\"" . get_option('blog_charset') . "\"\r\n";
//optional headerfields
$subject = wp_specialchars_decode(strip_tags(stripslashes($subject)), ENT_QUOTES);
$message = do_shortcode($message);
$message = wordwrap(stripslashes($message), 70, "\r\n");
//in case any lines are longer than 70 chars
if ($plain_text) {
$message = wp_specialchars_decode(strip_tags($message), ENT_QUOTES);
}
$header = apply_filters('frm_email_header', $header, compact('to_email', 'subject'));
if (!wp_mail($recipient, $subject, $message, $header, $attachments)) {
$header = "From: \"{$reply_to_name}\" <{$reply_to}>\r\n";
mail($recipient, $subject, $message, $header);
}
do_action('frm_notification', $recipient, $subject, $message);
}
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:28,代码来源:FrmNotification.php
示例2: wp_new_user_notification
/**
* Notify the blog admin of a new user, normally via email.
*
* @since 2.0
*
* @param int $user_id User ID
* @param string $plaintext_pass Optional. The user's plaintext password
*/
function wp_new_user_notification($user_id, $plaintext_pass = '')
{
global $LoginWithAjax;
//Copied out of /wp-includes/pluggable.php
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your blog %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if (empty($plaintext_pass)) {
return;
}
//LWA Customizations
if ($LoginWithAjax->data['notification_override'] == true) {
//We can use our own logic here
$LoginWithAjax->new_user_notification($user_login, $plaintext_pass, $user_email, $blogname);
} else {
//Copied out of /wp-includes/pluggable.php
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
$message .= wp_login_url() . "\r\n";
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
}
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:37,代码来源:pluggable.php
示例3: wp_new_user_notification
/**
* Email login credentials to a newly-registered user.
*
* A new user registration notification is also sent to admin email.
*
* @since 2.0.0
* @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
*
* @param int $user_id User ID.
* @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
* string (admin only), or 'both' (admin and user). The empty string value was kept
* for backward-compatibility purposes with the renamed parameter. Default empty.
*/
function wp_new_user_notification($user_id, $notify = '')
{
global $wpdb;
$user = get_userdata($user_id);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if ('admin' === $notify || empty($notify)) {
return;
}
// Generate something random for a password reset key.
$key = wp_generate_password(20, false);
/** This action is documented in wp-login.php */
do_action('retrieve_password_key', $user->user_login, $key);
// Now insert the key, hashed, into the DB.
if (empty($wp_hasher)) {
require_once ABSPATH . WPINC . '/class-phpass.php';
$wp_hasher = new PasswordHash(8, true);
}
$hashed = time() . ':' . $wp_hasher->HashPassword($key);
$wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
$message .= __('To set your password, visit the following address:') . "\r\n\r\n";
$message .= network_site_url("wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user->user_login), 'login') . "\r\n\r\n";
// $message .= wp_login_url() . "\r\n";
$message .= __('Make sure you click the RESET PASSWORD button to save your password.') . "\r\n\r\n";
wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
}
开发者ID:LastResortGames,项目名称:ludumdare-2008,代码行数:45,代码来源:sabre.php
示例4: custom_new_user_notification
function custom_new_user_notification($user_id, $deprecated = null, $notify = '', $password = null)
{
if ($deprecated !== null) {
_deprecated_argument(__FUNCTION__, '4.3.1');
}
global $wpdb, $wp_hasher;
$user = get_userdata($user_id);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if ('admin' === $notify || empty($notify)) {
return;
}
if ($password === null) {
$password = wp_generate_password(12, false);
}
// change the URL below to actual page with [adverts_manage] shortcode.
$manage_url = home_url() . "/adverts/manage/";
$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $password) . "\r\n";
$message .= 'To manage your Ads please use the following address ' . $manage_url . "\r\n";
wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
开发者ID:simpliko,项目名称:wpadverts-snippets,代码行数:27,代码来源:custom-registration-email.php
示例5: edd_pre_approval_emails_send_admin_email
/**
* Admin notification
*/
function edd_pre_approval_emails_send_admin_email($payment_id = 0, $payment_data = array())
{
$payment_id = absint($payment_id);
// get payment data from payment ID
$payment_data = edd_get_payment_meta($payment_id);
if (empty($payment_id)) {
return;
}
if (!edd_get_payment_by('id', $payment_id)) {
return;
}
$from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
$from_name = apply_filters('edd_purchase_from_name', $from_name, $payment_id, $payment_data);
$from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
$from_email = apply_filters('edd_purchase_from_address', $from_email, $payment_id, $payment_data);
$subject = sprintf(__('New pledge - Order #%1$s', 'edd-pre-approval-emails'), $payment_id);
$subject = wp_strip_all_tags($subject);
$subject = edd_do_email_tags($subject, $payment_id);
$headers = "From: " . stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8')) . " <{$from_email}>\r\n";
$headers .= "Reply-To: " . $from_email . "\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
$headers = apply_filters('edd_admin_pledge_notification_headers', $headers, $payment_id, $payment_data);
$attachments = apply_filters('edd_admin_pledge_notification_attachments', array(), $payment_id, $payment_data);
$message = edd_pre_approval_emails_get_admin_email_body($payment_id, $payment_data);
if (class_exists('EDD_Emails')) {
$emails = EDD()->emails;
$emails->__set('from_name', $from_name);
$emails->__set('from_email', $from_email);
$emails->__set('headers', $headers);
$emails->__set('heading', __('New Pledge!', 'edd-pre-approval-emails'));
$emails->send(edd_get_admin_notice_emails(), $subject, $message, $attachments);
}
}
开发者ID:mintplugins,项目名称:library,代码行数:36,代码来源:pre-approval-emails.php
示例6: wc_edd_email_purchase_receipt
/**
* Helper Functions
*/
function wc_edd_email_purchase_receipt($payment_id, $download_id)
{
$payment_data = edd_get_payment_meta($payment_id);
$download = get_post($download_id);
$license = edd_software_licensing()->get_license_by_purchase($payment_id, $download_id);
$from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
$from_name = apply_filters('edd_purchase_from_name', $from_name, $payment_id, $payment_data);
$from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
$from_email = apply_filters('edd_purchase_from_address', $from_email, $payment_id, $payment_data);
$to_email = edd_get_payment_user_email($payment_id);
$subject = edd_get_option('purchase_subject', __('New License Key', 'edd'));
$subject = apply_filters('edd_purchase_subject', wp_strip_all_tags($subject), $payment_id);
$subject = edd_do_email_tags($subject, $payment_id);
$message = "Dear " . edd_email_tag_first_name($payment_id) . ",\n\n";
$message .= "As you have updated " . $download->post_title . ", please use following new license key to continue getting future updates: \n\n";
$message .= "License Key : " . edd_software_licensing()->get_license_key($license->ID) . "\n\n";
$message .= "Sorry for inconvenience.";
$emails = EDD()->emails;
$emails->__set('from_name', $from_name);
$emails->__set('from_email', $from_email);
$emails->__set('heading', __('Purchase Receipt', 'edd'));
$headers = apply_filters('edd_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
$emails->__set('headers', $headers);
$emails->send($to_email, $subject, $message, array());
if ($admin_notice && !edd_admin_notices_disabled($payment_id)) {
do_action('edd_admin_sale_notice', $payment_id, $payment_data);
}
}
开发者ID:kishoresahoo,项目名称:woocommerce-to-easydigitaldownloads,代码行数:31,代码来源:software.php
示例7: wp_new_user_notification
/**
* Notify the blog admin of a new user, normally via email.
*
* @since 2.0
*
* @param int $user_id User ID
* @param string $plaintext_pass Optional. The user's plaintext password
*/
function wp_new_user_notification($user_id, $plaintext_pass = '', $flag='') {
if(func_num_args() > 1 && $flag !== 1)
return;
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if ( empty($plaintext_pass) )
return;
// 你可以在此修改发送给用户的注册通知Email
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
$message .= '登陆网址: ' . wp_login_url() . "\r\n";
// sprintf(__('[%s] Your username and password'), $blogname) 为邮件标题
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
开发者ID:ramo01,项目名称:1kapp,代码行数:38,代码来源:ludou-custom-register.php
示例8: get_from_name
/**
* Get the email from name
*
* @since 1.1.0
*/
public function get_from_name()
{
if (!$this->from_name) {
$this->from_name = get_bloginfo('name');
}
return wp_specialchars_decode($this->from_name);
}
开发者ID:stefanomarra,项目名称:smart-mockups,代码行数:12,代码来源:class-smart-mockups-emails.php
示例9: thousand_separator
/**
* Returns the thousand separator used by WC.
*
* @return string
*/
public static function thousand_separator()
{
if (empty(self::$wc_thousand_separator)) {
self::$wc_thousand_separator = wp_specialchars_decode(stripslashes(get_option('woocommerce_price_thousand_sep')), ENT_QUOTES);
}
return self::$wc_thousand_separator;
}
开发者ID:vanminh0910,项目名称:shangri-la,代码行数:12,代码来源:settings.php
示例10: notification
function notification ($addressee,$address,$subject,$template="order.php",$receipt="receipt.php") {
global $Ecart;
global $is_IIS;
if ($template == "order.php" && file_exists(ECART_TEMPLATES."/order.html")) $template = ECART_TEMPLATES."/order.html";
else $template = trailingslashit(ECART_TEMPLATES).$template;
if (!file_exists($template))
return new EcartError(__('A purchase notification could not be sent because the template for it does not exist.','purchase_notification_template',ECART_ADMIN_ERR));
// Send the e-mail receipt
$email = array();
$email['from'] = '"'.wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ).'"';
if ($Ecart->Settings->get('merchant_email'))
$email['from'] .= ' <'.$Ecart->Settings->get('merchant_email').'>';
if($is_IIS) $email['to'] = $address;
else $email['to'] = '"'.html_entity_decode($addressee,ENT_QUOTES).'" <'.$address.'>';
$email['subject'] = $subject;
$email['receipt'] = $this->receipt($receipt);
$email['url'] = get_bloginfo('siteurl');
$email['sitename'] = get_bloginfo('name');
$email['orderid'] = $this->id;
$email = apply_filters('ecart_email_receipt_data',$email);
if (ecart_email($template,$email)) {
if (ECART_DEBUG) new EcartError('A purchase notification was sent to: '.$email['to'],false,ECART_DEBUG_ERR);
return true;
}
if (ECART_DEBUG) new EcartError('A purchase notification FAILED to be sent to: '.$email['to'],false,ECART_DEBUG_ERR);
return false;
}
开发者ID:robbiespire,项目名称:paQui,代码行数:32,代码来源:Purchase.php
示例11: wp_new_user_notification_original
function wp_new_user_notification_original($user_id, $plaintext_pass = '', $include_fields = false, $activation_data = false, $welcome_email = '')
{
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$admin_email = get_option('admin_email');
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
// Get the site domain and get rid of www.
$sitename = strtolower($_SERVER['SERVER_NAME']);
if (substr($sitename, 0, 4) == 'www.') {
$sitename = substr($sitename, 4);
}
$from_email = 'wordpress@' . $sitename;
$headers = sprintf("From: %s <%s>\r\n\\", $blogname, $from_email);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
if ($include_fields) {
$message .= cimy_uef_mail_fields($user, $activation_data);
}
@wp_mail($admin_email, sprintf(__('[%s] New User Registration'), $blogname), $message, $headers);
if (empty($plaintext_pass)) {
return;
}
$welcome_email = str_replace("USERNAME", $user_login, $welcome_email);
$welcome_email = str_replace("PASSWORD", $plaintext_pass, $welcome_email);
if ($include_fields) {
$welcome_email .= cimy_uef_mail_fields($user, $activation_data);
}
$welcome_email = str_replace("LOGINLINK", wp_login_url(), $welcome_email);
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $welcome_email, $headers);
}
开发者ID:nunomorgadinho,项目名称:SimplePhone,代码行数:34,代码来源:cimy_uef_email_handler.php
示例12: friends_notification_accepted_request
function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id)
{
global $bp;
$friendship = new BP_Friends_Friendship($friendship_id, false, false);
$friend_name = bp_core_get_user_displayname($friend_id);
if ('no' == bp_get_user_meta((int) $initiator_id, 'notification_friends_friendship_accepted', true)) {
return false;
}
$ud = get_userdata($initiator_id);
$friend_link = bp_core_get_user_domain($friend_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($initiator_id) . $settings_slug . '/notifications';
// Set up and send the message
$to = $ud->user_email;
$sitename = wp_specialchars_decode(get_blog_option(bp_get_root_blog_id(), 'blogname'), ENT_QUOTES);
$subject = '[' . $sitename . '] ' . sprintf(__('%s accepted your friendship request', 'buddypress'), $friend_name);
$message = sprintf(__('%1$s accepted your friend request.
To view %2$s\'s profile: %3$s
---------------------
', 'buddypress'), $friend_name, $friend_name, $friend_link);
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
/* Send the message */
$to = apply_filters('friends_notification_accepted_request_to', $to);
$subject = apply_filters('friends_notification_accepted_request_subject', $subject, $friend_name);
$message = apply_filters('friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link);
wp_mail($to, $subject, $message);
do_action('bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id);
}
开发者ID:newington,项目名称:buddypress,代码行数:30,代码来源:bp-friends-notifications.php
示例13: localize_script
function localize_script()
{
global $woocommerce;
$options = get_option('wcbulkorderform_variation_template');
$display_images = isset($options['display_images']) ? $options['display_images'] : '';
$send_to_cart_or_checkout = isset($options['send_to_cart_or_checkout']) ? $options['send_to_cart_or_checkout'] : '';
$noproductsfound = __('No Products Were Found', 'wcbulkorderform');
$variation_noproductsfound = __('No Variations', 'wcbulkorderform');
$selectaproduct = __('Please Select a Product', 'wcbulkorderform');
$enterquantity = __('Enter Quantity', 'wcbulkorderform');
$decimal_sep = wp_specialchars_decode(stripslashes(get_option('woocommerce_price_decimal_sep')), ENT_QUOTES);
$thousands_sep = wp_specialchars_decode(stripslashes(get_option('woocommerce_price_thousand_sep')), ENT_QUOTES);
$num_decimals = absint(get_option('woocommerce_price_num_decimals'));
$minLength = 0;
$Delay = 500;
$single_buttons = $options['variation_display_format'];
if ($send_to_cart_or_checkout == 'checkout') {
$checkouttext = __('Checkout', 'woocommerce');
$checkouturl = $woocommerce->cart->get_checkout_url();
} else {
$checkouttext = __('Cart', 'woocommerce');
$checkouturl = $woocommerce->cart->get_cart_url();
}
wp_localize_script('wcbulkorder_acsearch', 'WCBulkOrder', array('url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('wcbulkorder-search-products'), 'display_images' => $display_images, 'noproductsfound' => $noproductsfound, 'selectaproduct' => $selectaproduct, 'enterquantity' => $enterquantity, 'variation_noproductsfound' => $variation_noproductsfound, 'variation_noproductsfound' => $variation_noproductsfound, 'decimal_sep' => $decimal_sep, 'thousands_sep' => $thousands_sep, 'num_decimals' => $num_decimals, 'Delay' => $Delay, 'minLength' => $minLength, 'single_buttons' => $single_buttons, 'checkouttext' => $checkouttext, 'checkouturl' => $checkouturl));
}
开发者ID:hslatman,项目名称:woocommerce-bulk-order-form,代码行数:25,代码来源:variation_search_template.php
示例14: wp_new_user_notification_original
function wp_new_user_notification_original($user_id, $plaintext_pass = '', $include_fields = false)
{
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
if ($include_fields) {
$message .= cimy_uef_mail_fields($user);
}
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if (empty($plaintext_pass)) {
return;
}
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
if ($include_fields) {
$message .= cimy_uef_mail_fields($user);
}
$message .= wp_login_url() . "\r\n";
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
开发者ID:jayfresh,项目名称:SweetSpot,代码行数:26,代码来源:cimy_uef_email_handler.php
示例15: wp_new_user_notification
/**
* Replaces the default wp_new_user_notification function of the core.
*
* Email login credentials to a newly-registered user.
* A new user registration notification is also sent to admin email.
*
* @since 1.0.0
* @access public
* @return void
*/
function wp_new_user_notification($user_id, $plaintext_pass)
{
$user = get_userdata($user_id);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
// Send notification to admin if not disabled.
if (!wpum_get_option('disable_admin_register_email')) {
$message = sprintf(__('New user registration on your site %s:', 'wpum'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s', 'wpum'), $user->user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s', 'wpum'), $user->user_email) . "\r\n";
wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration', 'wpum'), $blogname), $message);
}
/* == Send notification to the user now == */
if (empty($plaintext_pass)) {
return;
}
// Check if email exists first
if (wpum_email_exists('register')) {
// Retrieve the email from the database
$register_email = wpum_get_email('register');
$message = wpautop($register_email['message']);
$message = wpum_do_email_tags($message, $user_id, $plaintext_pass);
WPUM()->emails->__set('heading', __('Your account', 'wpum'));
WPUM()->emails->send($user->user_email, $register_email['subject'], $message);
}
}
开发者ID:CloouCom,项目名称:wp-user-manager,代码行数:37,代码来源:functions.php
示例16: woo_ce_escape_csv_value
function woo_ce_escape_csv_value( $string = '', $delimiter = ',', $format = 'all' ) {
global $export;
// Override the formatting for Debug Mode
if( WOO_CD_DEBUG ) {
$string = str_replace( '"', "'", $string );
$string = str_replace( PHP_EOL, "", $string );
} else {
$string = str_replace( '"', '""', $string );
$string = str_replace( PHP_EOL, "\r\n", $string );
}
$string = wp_specialchars_decode( $string );
$string = str_replace( "’", "'", $string );
// Override the escape formatting rule for XLS files
if( $export->export_format == 'xls' )
$format = 'all';
switch( $format ) {
case 'all':
$string = '"' . $string . '"';
break;
case 'excel':
if( strpos( $string, '"' ) !== false or strpos( $string, ',' ) !== false or strpos( $string, "\r" ) !== false or strpos( $string, "\n" ) !== false )
$string = '"' . $string . '"';
break;
}
return $string;
}
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:32,代码来源:formatting.php
示例17: x_shortcode_creative_cta
function x_shortcode_creative_cta($atts)
{
// 1
extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'padding' => '', 'text' => '', 'font_size' => '', 'icon' => '', 'icon_size' => '', 'image' => '', 'image_width' => '', 'animation' => '', 'link' => '', 'color' => '', 'bg_color' => '', 'bg_color_hover' => ''), $atts, 'x_creative_cta'));
$id = $id != '' ? 'id="' . esc_attr($id) . '"' : '';
$class = $class != '' ? 'x-creative-cta ' . esc_attr($class) : 'x-creative-cta';
$style = $style != '' ? ' ' . $style : '';
$padding = $padding != '' ? $padding : '35px';
$text = $text != '' ? wp_specialchars_decode($text, ENT_QUOTES) : 'Place Your<br>Text Here';
$font_size = $font_size != '' ? $font_size : '36px';
$icon = $icon != '' ? $icon : '';
$icon_size = $icon_size != '' ? $icon_size : '36px';
$image = $image != '' ? $image : '';
$image_width = $image_width != '' ? $image_width : '';
$animation = $animation != '' ? ' ' . $animation : '';
$link = $link != '' ? $link : '#';
$color = $color != '' ? $color : '#ffffff';
$bg_color = $bg_color != '' ? $bg_color : '#ff2a13';
$bg_color_hover = $bg_color_hover != '' ? $bg_color_hover : '#d80f0f';
if ($animation != '') {
if ($image != '') {
$graphic = '<span class="graphic"><img style="margin: 0; width: ' . $image_width . ';" src="' . $image . '"></span>';
} else {
if ($icon != '') {
$graphic = '<span class="graphic"><i style="margin: 0; font-size: ' . $icon_size . ';" class="x-icon-' . $icon . '" data-x-icon="&#x' . fa_unicode($icon) . ';"></i></span>';
}
}
} else {
$graphic = '';
}
$js_params = array('animation' => $animation, 'bg_color' => $bg_color, 'bg_color_hover' => $bg_color_hover);
$data = cs_generate_data_attributes('creative_cta', $js_params);
$output = "<a {$id} class=\"{$class}{$animation}\" href=\"{$link}\" style=\"padding: {$padding}; color: {$color}; background-color: {$bg_color};{$style}\" {$data}>" . "<span class=\"text\" style=\"font-size: {$font_size};\">{$text}</span>" . $graphic . "</a>";
return $output;
}
开发者ID:bitflipper1,项目名称:ghcontracting,代码行数:35,代码来源:creative-cta.php
示例18: wp_new_user_notification
function wp_new_user_notification($user_id, $deprecated = null, $notify = '')
{
if ($deprecated !== null) {
_deprecated_argument(__FUNCTION__, '4.3.1');
}
// `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notifcation.
if ('admin' === $notify || empty($deprecated) && empty($notify)) {
return;
}
global $wpdb, $wp_hasher;
$user = get_userdata($user_id);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
// Generate something random for a password reset key.
$key = wp_generate_password(20, false);
/** This action is documented in wp-login.php */
do_action('retrieve_password_key', $user->user_login, $key);
// Now insert the key, hashed, into the DB.
if (empty($wp_hasher)) {
require_once ABSPATH . WPINC . '/class-phpass.php';
$wp_hasher = new PasswordHash(8, true);
}
$hashed = time() . ':' . $wp_hasher->HashPassword($key);
$wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
$message .= __('To set your password, visit the following address:') . "\r\n\r\n";
$message .= '<' . network_site_url("wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user->user_login), 'login') . ">\r\n\r\n";
$message .= wp_login_url() . "\r\n";
wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
}
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:31,代码来源:cwwp-disable-new-user-emails.php
示例19: pmpro_send_html
function pmpro_send_html($phpmailer)
{
// Set the original plain text message
$phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);
// Clean < and > around text links in WP 3.1
$phpmailer->Body = preg_replace('#<(http://[^*]+)>#', '$1', $phpmailer->Body);
// Convert line breaks & make links clickable
$phpmailer->Body = make_clickable($phpmailer->Body);
// Add header to message if found
if (file_exists(get_stylesheet_directory() . "/email_header.html")) {
$phpmailer->Body = file_get_contents(get_stylesheet_directory() . "/email_header.html") . "\n" . $phpmailer->Body;
} elseif (file_exists(get_template_directory() . "/email_header.html")) {
$phpmailer->Body = file_get_contents(get_template_directory() . "/email_header.html") . "\n" . $phpmailer->Body;
}
// Add footer to message if found
if (file_exists(get_stylesheet_directory() . "/email_footer.html")) {
$phpmailer->Body = $phpmailer->Body . "\n" . file_get_contents(get_stylesheet_directory() . "/email_footer.html");
} elseif (file_exists(get_template_directory() . "/email_footer.html")) {
$phpmailer->Body = $phpmailer->Body . "\n" . file_get_contents(get_template_directory() . "/email_footer.html");
}
// Replace variables in email
global $current_user;
$data = array("name" => $current_user->display_name, "sitename" => get_option("blogname"), "login_link" => pmpro_url("account"), "display_name" => $current_user->display_name, "user_email" => $current_user->user_email, "subject" => $phpmailer->Subject);
foreach ($data as $key => $value) {
$phpmailer->Body = str_replace("!!" . $key . "!!", $value, $phpmailer->Body);
}
do_action("pmpro_after_phpmailer_init", $phpmailer);
do_action("pmpro_after_pmpmailer_init", $phpmailer);
//typo left in for backwards compatibility
}
开发者ID:Tanya-atsocial,项目名称:paid-memberships-pro,代码行数:30,代码来源:email.php
示例20: viradeco_new_user_notification
function viradeco_new_user_notification($user_id, $plaintext_pass = '')
{
$user = get_userdata($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$viraclub_id = get_user_meta($user_id, 'viraclub', 1);
$viraclub_id = $viraclub_id ? $viraclub_id : "";
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration in %s:', 'viradeco'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s', 'viradeco'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s', 'viradeco'), $user_email) . "\r\n";
$message .= sprintf(__('Vira Club ID : V%s', 'viradeco'), $viraclub_id) . "\r\n";
wp_mail(get_option('admin_email'), sprintf(__('New User Registration', 'viradeco'), $blogname), $message);
if (empty($plaintext_pass)) {
return;
}
$message = __('Your Information : ', 'viradeco') . "\r\n";
$message .= sprintf(__('Username: %s', 'viradeco'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s', 'viradeco'), $plaintext_pass) . "\r\n";
$message .= sprintf(__('Vira Club ID : V%s', 'viradeco'), $viraclub_id) . "\r\n";
$message .= get_the_permalink() . "\r\n";
wp_mail($user_email, sprintf(__('Welcome to Vira', 'viradeco'), $blogname), $message);
}
开发者ID:hamednourhani,项目名称:viradeco.com,代码行数:25,代码来源:notifications.php
注:本文中的wp_specialchars_decode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论