google_auth( $code ); break; } do_action('timetics_integration_auth', $query_var, $code ); $redirect_url = admin_url('admin.php?page=timetics#/my-profile'); if ( current_user_can('manage_options') ) { $redirect_url = admin_url('admin.php?page=timetics#/settings'); } wp_redirect( $redirect_url ); exit; } /** * Authentication for google * * @param string $code * * @return void */ public function google_auth( $code = '' ) { $client = timetics_get_google_client(); $client->add_scope( Calendar::scope() ); $data = $client->fetch_access_token_with_auth_code( $code ); $data['code'] = $code; timetics_update_google_auth( get_current_user_id(), $data ); } /** * Authentication for zoom * * @param string $code * * @return void */ public function zoom_auth( $code = '' ) { // Override this function to authenticate zoom } }