Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

MP_Addon_ConstantContact_Settings::get_token_button( array $args )

Get Constant Contact token button.


Description Description

Authorization or revoke token.


Top ↑

Parameters Parameters

$args

(array) (Required) arguments of setting


Top ↑

Return Return

(string) button


Top ↑

Source Source

File: calculator-constant-contact-add-on/inc/MP_Addon_ConstantContact_Settings.php

	private function get_token_button($args){

		$name        = $args['label_for'];
		$option_name = $args['option_name'];
		$input       = get_option( $option_name );
		$description = $args['description'];
		$default     = $args['default'];
		$value       = isset( $input[ $name ] ) ? $input[ $name ] : $default;


		$constant_contact = new MP_Addon_ConstantContact();

		if( empty(get_option( MortgagePlatform::$prefix . 'constant_contact_refresh_token' ))) {

			$url = $constant_contact->get_url();

			echo '<a href="'.esc_url($url).'" class="button" target="_blank">'.esc_attr($value).'</a>';
			echo '<p>' . esc_attr( $description ) . '</p>';
		} else {

			$constant_contact->get_client();

			echo '<div class="constant_contact_token" style="float:left">';
			echo '<span class="spinner"></span>';
			echo '<button id="constant_contact_token_revoke" class="button">' . esc_attr__( "Revoke Token", "CalculatorsConstantContactAddon" ) . '</button>';
			echo '</div>';
			echo '<input id="constant_contact_revoke_nonce" type="hidden" value="' . wp_create_nonce( "constant_contact" ) . '">';
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.