Skip to content

Commit

Permalink
Removed all the array shorthand changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mchirag2002 committed Jul 31, 2024
1 parent f94bc5b commit d7dd905
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Modules/OneTapLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ public function name(): string {
*/
public function init(): void {
if ( $this->settings->one_tap_login ) {
add_action( 'login_enqueue_scripts', array( $this, 'one_tap_scripts' ) );
add_action( 'login_footer', array( $this, 'one_tap_prompt' ) );
add_action( 'wp_ajax_nopriv_validate_id_token', array( $this, 'validate_token' ) );
add_action( 'rtcamp.id_token_verified', array( $this, 'authenticate' ) );
add_action( 'login_enqueue_scripts', [ $this, 'one_tap_scripts' ] );
add_action( 'login_footer', [ $this, 'one_tap_prompt' ] );
add_action( 'wp_ajax_nopriv_validate_id_token', [ $this, 'validate_token' ] );
add_action( 'rtcamp.id_token_verified', [ $this, 'authenticate' ] );
add_action(
'init',
function () {
if ( ! is_user_logged_in() ) {
$hook_prefix = ( 'sitewide' === $this->settings->one_tap_login_screen ) ? 'wp' : 'login';
add_action( $hook_prefix . '_enqueue_scripts', array( $this, 'one_tap_scripts' ) );
add_action( $hook_prefix . '_footer', array( $this, 'one_tap_prompt' ), 10000 );
add_action( $hook_prefix . '_enqueue_scripts', [ $this, 'one_tap_scripts' ] );
add_action( $hook_prefix . '_footer', [ $this, 'one_tap_prompt' ], 10000 );
}
}
);
Expand Down Expand Up @@ -125,23 +125,23 @@ public function one_tap_scripts(): void {
wp_enqueue_script(
'login-with-google-one-tap',
'https://accounts.google.com/gsi/client',
array(),
[],
filemtime( trailingslashit( plugin()->path ) . 'assets/build/js/onetap.js' ),
true
);

$data = array(
$data = [
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'state' => $this->google_client->state(),
'homeurl' => get_option( 'home', '' ),
);
];

wp_register_script(
'login-with-google-one-tap-js',
trailingslashit( plugin()->url ) . 'assets/build/js/' . $filename,
array(
[
'wp-i18n',
),
],
filemtime( trailingslashit( plugin()->path ) . 'assets/build/js/onetap.js' ),
true
);
Expand Down Expand Up @@ -188,9 +188,9 @@ public function validate_token(): void {
}

wp_send_json_success(
array(
[
'redirect' => $redirect_to,
)
]
);
die;

Expand Down

0 comments on commit d7dd905

Please sign in to comment.