You appear to be a bot. Output may be restricted
Description
Modify User Profile
Modifies the output of profile.php to add key generation/revocation
Usage
$void = EDD_API::user_key_field( $user );
Parameters
- $user
- ( object ) required – Current user info
Returns
void
Source
File name: easy-digital-downloads/includes/api/class-edd-api.php
Lines:
1 to 31 of 31
function user_key_field( $user ) { if ( ( edd_get_option( 'api_allow_user_keys', false ) || current_user_can( 'manage_shop_settings' ) ) && current_user_can( 'edit_user', $user->ID ) ) { $user = get_userdata( $user->ID ); ?> <table class="form-table"> <tbody> <tr> <th> <?php _e( 'Easy Digital Downloads API Keys', 'easy-digital-downloads' ); ?> </th> <td> <?php $public_key = $this->get_user_public_key( $user->ID ); $secret_key = $this->get_user_secret_key( $user->ID ); ?> <?php if ( empty( $user->edd_user_public_key ) ) { ?> <input name="edd_set_api_key" type="checkbox" id="edd_set_api_key" value="0" /> <span class="description"><?php _e( 'Generate API Key', 'easy-digital-downloads' ); ?></span> <?php } else { ?> <strong style="display:inline-block; width: 125px;"><?php _e( 'Public key:', 'easy-digital-downloads' ); ?> </strong><input type="text" disabled="disabled" class="regular-text" id="publickey" value="<?php echo esc_attr( $public_key ); ?>"/><br/> <strong style="display:inline-block; width: 125px;"><?php _e( 'Secret key:', 'easy-digital-downloads' ); ?> </strong><input type="text" disabled="disabled" class="regular-text" id="privatekey" value="<?php echo esc_attr( $secret_key ); ?>"/><br/> <strong style="display:inline-block; width: 125px;"><?php _e( 'Token:', 'easy-digital-downloads' ); ?> </strong><input type="text" disabled="disabled" class="regular-text" id="token" value="<?php echo esc_attr( $this->get_token( $user->ID ) ); ?>"/><br/> <input name="edd_set_api_key" type="checkbox" id="edd_set_api_key" value="0" /> <span class="description"><label for="edd_set_api_key"><?php _e( 'Revoke API Keys', 'easy-digital-downloads' ); ?></label></span> <?php } ?> </td> </tr> </tbody> </table> <?php } }