• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_API::user_key_field() – Modify User Profile

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 }
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 12th September 2021

Primary Sidebar

Information

Function name: EDD_API::user_key_field
Class ref: EDD_API
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/api/class-edd-api.php
File ref: includes/api/class-edd-api.php
Deprecated?: No
API Letters: A,E,F,K,U

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 6.0
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins