WordPress Advanced Customization - gigya/wordpress GitHub Wiki
This document described advanced customization options for the Gigya Plugin for WordPress.
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.
Gigya's WordPress plugin provide the following actions:
Action Name | Parameters | Description |
---|---|---|
gigya_after_raas_login |
|
Action after RaaS login. Among other this action allows you to Map Profile Fields from RaaS to WordPress. |
gigya_after_social_login |
|
Action after Social Login. |
gigya_before_raas_register |
|
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 |
|
Action before Social Login register new user to WP. Provides you with a way to add extra validation just before registering new user. |
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 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. |
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";
}