Skip to content

Commit

Permalink
Enqueue jQuery and wp.apiRequest for use within callbacks. (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored May 3, 2023
1 parent c725c9b commit ff00842
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions providers/class-two-factor-backup-codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public function is_available_for_user( $user ) {
* @param WP_User $user WP_User object of the logged-in user.
*/
public function user_options( $user ) {
wp_enqueue_script( 'wp-api-request' );
wp_enqueue_script( 'jquery' );

$count = self::codes_remaining_for_user( $user );
?>
<p id="two-factor-backup-codes">
Expand Down
2 changes: 2 additions & 0 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public function user_two_factor_options( $user ) {
$key = $this->get_user_totp_key( $user->ID );

wp_enqueue_script( 'two-factor-qr-code-generator' );
wp_enqueue_script( 'wp-api-request' );
wp_enqueue_script( 'jquery' );

?>
<div id="two-factor-totp-options">
Expand Down

0 comments on commit ff00842

Please sign in to comment.