本文整理汇总了PHP中wp_specialchars_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_specialchars_decode函数的具体用法?PHP wp_specialchars_decode怎么用?PHP wp_specialchars_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_specialchars_decode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
}