WordPress Advanced Customization - gigya/wordpress GitHub Wiki

This document described advanced customization options for the Gigya Plugin for WordPress.

Hooks - Actions and Filters

Gigya plugin provides a set of hooks that provide windows for extending or overriding the Gigya functionality. You can create your own custom plugin and implement any of the actions and filters specified below.

Actions

Gigya's WordPress plugin provide the following actions:

Action Name Parameters Description
gigya_after_raas_login
  • $gigya_account- Gigya’s account object.
  • $wp_user - WP user object
Action after RaaS login.
Among other this action allows you to Map Profile Fields from RaaS to WordPress.
gigya_after_social_login
  • $gigya_user- Gigya’s user object.
  • $wp_user - WP user object
Action after Social Login.
gigya_before_raas_register
  • $name - user's name
  • $email - user's email
Action before RaaS register new user to WP. Provides you with a way to add extra validation just before registering new user.
gigya_before_social_register
  • $name - user's name
  • $email - user's email
Action before Social Login register new user to WP. Provides you with a way to add extra validation just before registering new user.

Code Example

In the following example, we use the "gigya_after_raas_login" action to update the Age field from RaaS Profile object into WordPress's user entity. The update will occur each time the user logs in to the site:

add_action( 'gigya_after_raas_login', 'gigyaAfterRaasLogin', 10, 2 );
function gigyaAfterRaasLogin( $gig_user, $wp_user ) {
// Update the WP nickname from Gigya’s nickname.
update_user_meta( $wp_user->ID, 'nickname', $gig_user['profile']['nickname'] );
}

Please note that an Age field does not exist out-of-the-box in WordPress user entity. For the above example to work, you would need to preliminary add an Age field to the WP user entity.

Filters

Filters give you the possibility to modify a set of parameters of a method call before it is sent to Gigya server. Gigya's WordPress plugin provides the following filters:

Filter Name Parameters Description
gigya_login_params $params Allows you to modify the Wordpress + Social Login settings and add additional parameters that are supported by the socialize.showLoginUI API method.
gigya_raas_params $params Allows you to modify the Registration-as-a-Service settings and add additional parameters that are supported by the accounts.showScreenSet API method.
gigya_feed_params Deprecated.

Code Example

In the following example, we use the "gigya_gamification_params" filter to add a custom Gamification challenge:

  add_filter( 'gigya_gamification_params', 'gigyaGamifiactionAddParams', 10, 1 );
  function gigyaGamifiactionAddParams( $params ) {
  // add the challange parameter.
  $params['challange'] = "myCustomChallangeID";
  }
⚠️ **GitHub.com Fallback** ⚠️