send_recovery_mode_email example


    public function maybe_send_recovery_mode_email( $rate_limit$error$extension ) {

        $last_sent = get_option( self::RATE_LIMIT_OPTION );

        if ( ! $last_sent || time() > $last_sent + $rate_limit ) {
            if ( ! update_option( self::RATE_LIMIT_OPTION, time() ) ) {
                return new WP_Error( 'storage_error', __( 'Could not update the email last sent time.' ) );
            }

            $sent = $this->send_recovery_mode_email( $rate_limit$error$extension );

            if ( $sent ) {
                return true;
            }

            return new WP_Error(
                'email_failed',
                sprintf(
                    /* translators: %s: mail() */
                    __( 'The email could not be sent. Possible reason: your host may have disabled the %s function.' ),
                    'mail()'
                )
Home | Imprint | This part of the site doesn't use cookies.