Making WordPress.org

Changeset 6757


Ignore:
Timestamp:
02/26/2018 05:38:35 AM (7 years ago)
Author:
tellyworth
Message:

2FA: make sure ajaxurl is available, not just for debug bar users.

See #77

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor/js/profile-edit.js

    r6747 r6757  
    55
    66        $.post(
    7             ajaxurl,
     7            two_factor_edit.ajaxurl,
    88            {
    99                action      : 'two-factor-disable',
     
    6161
    6262            $.post(
    63                 ajaxurl,
     63                two_factor_edit.ajaxurl,
    6464                {
    6565                    action      : 'two-factor-totp-verify-code',
     
    8484    $( '#generate-backup-codes' ).on( 'click', function() {
    8585        $.post(
    86             ajaxurl,
     86            two_factor_edit.ajaxurl,
    8787            {
    8888                action: 'two_factor_backup_codes_generate',
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor/wporg-two-factor.php

    r6753 r6757  
    223223    public static function user_two_factor_options( $user ) {
    224224        wp_enqueue_script( 'two-factor-edit', plugins_url( 'js/profile-edit.js' , __FILE__ ), [ 'jquery' ], 1, true );
     225        wp_localize_script( 'two-factor-edit', 'two_factor_edit', array(
     226            'ajaxurl' => admin_url( 'admin-ajax.php' ),
     227        ) );
    225228
    226229        $key       = get_user_meta( $user->ID, Two_Factor_Totp::SECRET_META_KEY, true );
Note: See TracChangeset for help on using the changeset viewer.