wp_specialchars_decode example

clean_user_cache( $user_obj );

    // Merge old and new fields with new fields overwriting old ones.     $userdata = array_merge( $user$userdata );
    $user_id  = wp_insert_user( $userdata );

    if ( is_wp_error( $user_id ) ) {
        return $user_id;
    }

    $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );

    $switched_locale = false;
    if ( ! empty( $send_password_change_email ) || ! empty( $send_email_change_email ) ) {
        $switched_locale = switch_to_user_locale( $user_id );
    }

    if ( ! empty( $send_password_change_email ) ) {
        /* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */
        $pass_change_text = __(
            'Hi ###USERNAME###, This notice confirms that your password was changed on ###SITENAME###. If you did not change your password, please contact the Site Administrator at ###ADMIN_EMAIL### This email has been sent to ###EMAIL### Regards, All at ###SITENAME### ###SITEURL###'
case 'critical': // We tried to update, started to copy files, then things went wrong.                 /* translators: Site down notification email subject. 1: Site title. */
                $subject = __( '[%1$s] URGENT: Your site may be down due to a failed update' );
                break;

            default:
                return;
        }

        // If the auto-update is not to the latest version, say that the current version of WP is available instead.         $version = 'success' === $type ? $core_update->current : $next_user_core_update->current;
        $subject = sprintf( $subjectwp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )$version );

        $body = '';

        switch ( $type ) {
            case 'success':
                $body .= sprintf(
                    /* translators: 1: Home URL, 2: WordPress version. */
                    __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ),
                    home_url(),
                    $core_update->current
                );
                

    $content = apply_filters( 'new_admin_email_content', $email_text$new_admin_email );

    $current_user = wp_get_current_user();
    $content      = str_replace( '###USERNAME###', $current_user->user_login, $content );
    $content      = str_replace( '###ADMIN_URL###', esc_url( self_admin_url( 'options.php?adminhash=' . $hash ) )$content );
    $content      = str_replace( '###EMAIL###', $value$content );
    $content      = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )$content );
    $content      = str_replace( '###SITEURL###', home_url()$content );

    if ( '' !== get_option( 'blogname' ) ) {
        $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    } else {
        $site_title = parse_url( home_url(), PHP_URL_HOST );
    }

    wp_mail(
        $value,
        sprintf(
            
$content = str_replace( '###USERNAME###', $user->user_login, $content );
    $content = str_replace( '###URL_DELETE###', $url_delete$content );
    $content = str_replace( '###SITENAME###', get_network()->site_name, $content );
    $content = str_replace( '###SITEURL###', network_home_url()$content );

    wp_mail(
        get_option( 'admin_email' ),
        sprintf(
            /* translators: %s: Site title. */
            __( '[%s] Delete My Site' ),
            wp_specialchars_decode( get_option( 'blogname' ) )
        ),
        $content
    );

    if ( $switched_locale ) {
        restore_previous_locale();
    }
    ?> <p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p>

    private function send_recovery_mode_email( $rate_limit$error$extension ) {

        $url      = $this->link_service->generate_url();
        $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );

        $switched_locale = switch_to_locale( get_locale() );

        if ( $extension ) {
            $cause   = $this->get_cause( $extension );
            $details = wp_strip_all_tags( wp_get_extension_error_description( $error ) );

            if ( $details ) {
                $header  = __( 'Error Details' );
                $details = "\n\n" . $header . "\n" . str_pad( '', strlen( $header ), '=' ) . "\n" . $details;
            }
        }
$switched_locale = switch_to_locale( get_locale() );
    }

    /** This filter is documented in wp-includes/functions.php */
    $expiration      = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
    $expiration_date = date_i18n( get_option( 'date_format' )time() + $expiration );

    $exports_url      = wp_privacy_exports_url();
    $export_file_name = get_post_meta( $request_id, '_export_file_name', true );
    $export_file_url  = $exports_url . $export_file_name;

    $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    $site_url  = home_url();

    /** * Filters the recipient of the personal data export email notification. * Should be used with great caution to avoid sending the data export link to wrong emails. * * @since 5.3.0 * * @param string $request_email The email address of the notification recipient. * @param WP_User_Request $request The request that is initiating the notification. */
    

            do_action( 'invite_user', $user_id$role$newuser_key );

            $switched_locale = switch_to_user_locale( $user_id );

            if ( '' !== get_option( 'blogname' ) ) {
                $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
            } else {
                $site_title = parse_url( home_url(), PHP_URL_HOST );
            }

            /* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */
            $message = __(
                'Hi, You\'ve been invited to join \'%1$s\' at %2$s with the role of %3$s. Please click the following link to confirm the invite: %4$s'
$original_object = get_post( $args['menu-item-object-id'] );
            $original_parent = (int) $original_object->post_parent;
            $original_title  = $original_object->post_title;
        } elseif ( 'post_type_archive' === $args['menu-item-type'] ) {
            $original_object = get_post_type_object( $args['menu-item-object'] );
            if ( $original_object ) {
                $original_title = $original_object->labels->archives;
            }
        }

        if ( wp_unslash( $args['menu-item-title'] ) === wp_specialchars_decode( $original_title ) ) {
            $args['menu-item-title'] = '';
        }

        // Hack to get wp to create a post object when too many properties are empty.         if ( '' === $args['menu-item-title'] && '' === $args['menu-item-description'] ) {
            $args['menu-item-description'] = ' ';
        }
    }

    // Populate the menu item object.     $post = array(
        
$path,
            $title,
            $user_login,
            $user_email,
            $key,
            $meta
        ),
        $from_name,
        esc_url( 'http://' . $domain . $path )
    );

    wp_mail( $user_emailwp_specialchars_decode( $subject )$message$message_headers );

    if ( $switched_locale ) {
        restore_previous_locale();
    }

    return true;
}

/** * Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site * at the same time). The user account will not become active until the confirmation link is clicked. * * This is the notification function used when no new site has * been requested. * * Filter {@see 'wpmu_signup_user_notification'} to bypass this function or * replace it with your own notification behavior. * * Filter {@see 'wpmu_signup_user_notification_email'} and * {@see 'wpmu_signup_user_notification_subject'} to change the content * and subject line of the email sent to newly registered users. * * @since MU (3.0.0) * * @param string $user_login The user's login name. * @param string $user_email The user's email address. * @param string $key The activation key created in wpmu_signup_user() * @param array $meta Optional. Signup meta data. Default empty array. * @return bool */


    $email_change_email = array(
        'to'      => $old_email,
        /* translators: Site admin email change notification email subject. %s: Site title. */
        'subject' => __( '[%s] Admin Email Changed' ),
        'message' => $email_change_text,
        'headers' => '',
    );

    // Get site name.     $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );

    /** * Filters the contents of the email notification sent when the site admin email address is changed. * * @since 4.9.0 * * @param array $email_change_email { * Used to build wp_mail(). * * @type string $to The intended recipient. * @type string $subject The subject of the email. * @type string $message The content of the email. * The following strings have a special meaning and will get replaced dynamically: * - ###OLD_EMAIL### The old site admin email address. * - ###NEW_EMAIL### The new site admin email address. * - ###SITENAME### The name of the site. * - ###SITEURL### The URL to the site. * @type string $headers Headers. * } * @param string $old_email The old site admin email address. * @param string $new_email The new site admin email address. */
/** * @since MU (3.0.0) * * @param string $text * @return string */
function admin_created_user_email( $text ) {
    $roles = get_editable_roles();
    $role  = $roles[ $_REQUEST['role'] ];

    if ( '' !== get_bloginfo( 'name' ) ) {
        $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
    } else {
        $site_title = parse_url( home_url(), PHP_URL_HOST );
    }

    return sprintf(
        /* translators: 1: Site title, 2: Site URL, 3: User role. */
        __(
            'Hi, You\'ve been invited to join \'%1$s\' at %2$s with the role of %3$s. If you do not want to join this site please ignore this email. This invitation will expire in a few days. Please click the following link to activate your user account: %%s'
$switched_locale = switch_to_locale( get_locale() );

        $comment_author_domain = '';
        if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {
            $comment_author_domain = gethostbyaddr( $comment->comment_author_IP );
        }

        /* * 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 );
        $comment_content = wp_specialchars_decode( $comment->comment_content );

        switch ( $comment->comment_type ) {
            case 'trackback':
                /* translators: %s: Post title. */
                $notify_message = sprintf( __( 'New trackback on your post "%s"' )$post->post_title ) . "\r\n";
                /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */
                $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' )$comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
                /* translators: %s: Trackback/pingback/comment author URL. */
                $notify_message .= sprintf( __( 'URL: %s' )$comment->comment_author_url ) . "\r\n";
                /* translators: %s: Comment text. */
                
Home | Imprint | This part of the site doesn't use cookies.