Init Current Auth User Element
Initiates the authentication process of an WordPress User and displays the data of the user.
When to use?
When you want to link WordPress User Accounts with an Alexa Skill.
How to use:
-
Make sure you already have configured and propagated your service to Amazon Alexa with Account Linking enabled in Account Linking Mode 'Installation'.
-
Enter variable name for the user in Name field Name under which to store the loaded user object in the context
-
You can leave the Set as Current User checked as this will set the current wp user as the User which has linked the account. Initially no user is set in the service. Functions which leverage
wp_get_current_user() will benefit the most of this option being enabled which will be used in the service.
-
If you want to prompt account linking directly from the element, just check Prompt for linking. To initiate prompt account linking, You can also use the Prompt Account Linking element which is in convo-core package.
-
After the account linking process was successfully finished, you'll be able to access the WP_User object like in the following examples:
${user.ID}
${user.nickname}
${user.user_email}
${user.get().get('user_email')}
${user.get().to_array()['user_email']}
${user.get().has_cap('manage_convoworks')}
For more info on the WP_User object, please visit the Official WordPress documentation here.