Skip to content

Latest commit

 

History

History
206 lines (143 loc) · 6.66 KB

File metadata and controls

206 lines (143 loc) · 6.66 KB

Action Hooks

Table of Contents

Activation / Deactivation

graphql_login_activate

Runs when the plugin is activated.

do_action( 'graphql_login_activate' );

graphql_login_deactivate

Runs when the plugin is deactivated.

do_action( 'graphql_login_deactivate' );

graphql_login_delete_data

Runs after the plugin deletes its data on deactivate.

do_action( 'graphql_login_delete_data' );

Lifecycle

graphql_login_init

Runs when the plugin is initialized.

do_action( 'graphql_login_init', $instance );

Parameters

  • $instance (WPGraphQL\Login\Main) : The instance of the plugin.

graphql_login_before_register_types

Runs before the plugin registers any GraphQL types to the schema.

do_action( 'graphql_login_before_register_types' );

graphql_login_after_register_types

Runs after the plugin finishes registering all GraphQL types to the schema.

do_action( 'graphql_login_after_register_types' );

graphql_login_after_provider_init

Fires after a Login Provider has been initialized.

do_action( 'graphql_login_after_provider_init', $slug, $provider_config );

Parameters

  • $slug (string) : The provider slug.
  • $provider_config (WPGraphQL\Login\Auth\ProviderConfig\ProviderConfig) : The instance of the ProviderConfig.

graphql_login_client_init

Fires when a Login Client is initialized.

do_action( 'graphql_login_client_init', $slug, $settings, $provider_config, $client );

Parameters

  • $slug (string) : The provider slug.
  • $settings (array) : The client settings.
  • $provider_config (WPGraphQL\Login\Auth\ProviderConfig\ProviderConfig) : The instance of the ProviderConfig.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_before_authenticate

Fires before the user is authenticated with the provider.

do_action( 'graphql_login_before_authenticate', $slug, $input, $settings, $provider_config, $client );

Parameters

  • $slug (string) : The provider slug.
  • $input (array) : The mutation input data.
  • $settings (array) : The client settings.
  • $provider_config (WPGraphQL\Login\Auth\ProviderConfig\ProviderConfig) : The instance of the ProviderConfig.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_after_authenticate

Fires after the user is authenticated with the provider.

do_action( 'graphql_login_after_authenticate', $user_data, $slug, $input, $settings, $provider_config, $client );

Parameters

  • $user_data (array<string,mixed>|\WP_User|\WP_Error|false) : The user data from the Authentication provider.
  • $slug (string) : The provider slug.
  • $input (array) : The mutation input data.
  • $settings (array) : The client settings.
  • $provider_config (WPGraphQL\Login\Auth\ProviderConfig\ProviderConfig) : The instance of the ProviderConfig.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_get_user_from_data

Fires when the user is matched from the data. Useful for updating custom meta fields from the provider.

do_action( 'graphql_login_get_user_from_data', $user, $user_data, $slug, $settings, $provider_config, $client );

Parameters

  • $user _( \WP_User|\WP_Error|false) : The user object matched from the data.
  • $user_data (array<string,mixed>|\WP_User) : The user data from the Authentication provider.
  • $slug (string) : The provider slug.
  • $settings (array) : The client settings.
  • $provider_config (WPGraphQL\Login\Auth\ProviderConfig\ProviderConfig) : The instance of the ProviderConfig.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_validate_client

Fires when validating the client instance.

do_action( 'graphql_login_validate_client', $client );

Parameters

  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_after_successful_login

Fires after the user is successfully logged in.

do_action( 'graphql_login_after_successful_login', $payload, $user, $user_data, $client );

Parameters

  • $payload (array) : The payload data.
    • $payload['authToken'] (string) : The user's Auth Token.
    • $payload['authTokenExpiration'] (int) : The expiration timestamp of the Auth Token.
    • $payload['refreshToken'] (string) : The user's Refresh Token.
    • $payload['refreshTokenExpiration'] (int) : The expiration timestamp of the Refresh Token.
    • $payload['user'] (WP_User) : The user object.
  • $user_data (array<string,mixed>|\WP_User|false) : The user data from the Authentication provider.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

graphql_login_link_user_identity

Fires when linking a user identity.

do_action( 'graphql_login_link_user_identity', $linked_user, $user_data, $client );

Parameters

  • $linked_user (WP_User|false) : The user object. False if the identity could not be linked.
  • $user_data (array) : The user data from the Authentication provider.
  • $client (WPGraphQL\Login\Auth\Client) : The instance of the Client.

Reference