public function ajaxClear() {
		$plugin = ! empty( $_POST['plugin'] ) ? sanitize_text_field( $_POST['plugin'] ) : null;

		if ( empty( $plugin ) ) {
			wp_send_json_error( __( 'Unknown plugin.', 'boldgrid-library' ) );
		}

		if ( ! current_user_can( 'manage_options' ) ) {
			wp_send_json_error( __( 'Access denied.', 'boldgrid-library' ) );
		}

		$success = $this->clearTransient();
		if ( ! $success ) {
			wp_send_json_error( array(
				'string' => sprintf(
					// translators: 1 The name of a transient that we were unable to delete.
					__( 'Failed to clear license data. Unable to delete site transient "%1$s".', 'boldgrid-library' ),
					$this->getKey()
				),
			));
		}

		$this->initLicense();

		$return = array(
			'isPremium' => $this->isPremium( $plugin ),
			'string' => $this->licenseString,
		);

		wp_send_json_success( $return );
	}
public function ajaxClear() {
		$plugin = ! empty( $_POST['plugin'] ) ? sanitize_text_field( $_POST['plugin'] ) : null;

		if ( empty( $plugin ) ) {
			wp_send_json_error( __( 'Unknown plugin.', 'boldgrid-library' ) );
		}

		if ( ! current_user_can( 'manage_options' ) ) {
			wp_send_json_error( __( 'Access denied.', 'boldgrid-library' ) );
		}

		$success = $this->clearTransient();
		if ( ! $success ) {
			wp_send_json_error( array(
				'string' => sprintf(
					// translators: 1 The name of a transient that we were unable to delete.
					__( 'Failed to clear license data. Unable to delete site transient "%1$s".', 'boldgrid-library' ),
					$this->getKey()
				),
			));
		}

		$this->initLicense();

		$return = array(
			'isPremium' => $this->isPremium( $plugin ),
			'string' => $this->licenseString,
		);

		wp_send_json_success( $return );
	}
public function ajaxClear ( ) { $ plugin = ! empty ( $ _POST [ 'plugin' ] ) ? sanitize_text_field ( $ _POST [ 'plugin' ] ) : null ; if ( empty ( $ plugin ) ) { wp_send_json_error ( __ ( 'Unknown plugin.' , 'boldgrid-library' ) ) ; } if ( ! current_user_can ( 'manage_options' ) ) { wp_send_json_error ( __ ( 'Access denied.' , 'boldgrid-library' ) ) ; } $ success = $ this -> clearTransient ( ) ; if ( ! $ success ) { wp_send_json_error ( array ( 'string' => sprintf ( // translators: 1 The name of a transient that we were unable to delete. __ ( 'Failed to clear license data. Unable to delete site transient "%1$s".' , 'boldgrid-library' ) , $ this -> getKey ( ) ) , ) ) ; } $ this -> initLicense ( ) ; $ return = array ( 'isPremium' => $ this -> isPremium ( $ plugin ) , 'string' => $ this -> licenseString , ) ; wp_send_json_success ( $ return ) ; }
Handle ajax request to clear license data.

@since 2.2.0

@hook: wp_ajax_bg_clear_license
Handle ajax request to clear license data .