PHP 8.2.31
Preview: education.php Size: 2.89 KB
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/wpforms-lite/includes/functions/education.php

<?php
/**
 * Helpers functions for the Education pages.
 *
 * @since 1.8.2.2
 */

/**
 * Get the button.
 *
 * @since 1.8.2.2
 * @since 1.9.6.1 Add $license_level parameter.
 *
 * @param string $action        Action to perform.
 * @param bool   $plugin_allow  Is plugin allowed.
 * @param string $path          Plugin file.
 * @param string $url           URL for download plugin.
 * @param array  $utm           UTM parameters.
 * @param string $license_level License level.
 */
function wpforms_edu_get_button( $action, $plugin_allow, $path, $url, $utm, $license_level = '' ) {

	// If the user is not allowed to use the plugin, show the upgrade button.
	if ( ! $plugin_allow ) {
		wpforms_edu_get_upgrade_button( $utm, [], $license_level );

		return;
	}

	$status      = 'inactive';
	$data_plugin = $path;
	$title       = esc_html__( 'Activate', 'wpforms-lite' );
	$can_install = wpforms_can_install( 'addon' );

	if ( $action === 'install' ) {
		$status      = 'download';
		$data_plugin = $url;
		$title       = esc_html__( 'Install & Activate', 'wpforms-lite' );
	}

	?>

	<?php if ( $action === 'install' && ! $can_install ) : ?>
		<div class="wpforms-notice wpforms-error">
			<p><?php esc_html_e( 'Plugin installation is disabled for this site.', 'wpforms-lite' ); ?></p>
		</div>
	<?php else : ?>
		<button
			class="status-<?php echo esc_attr( $status ); ?> wpforms-btn wpforms-btn-lg wpforms-btn-blue wpforms-education-toggle-plugin-btn"
			data-type="addon"
			data-action="<?php echo esc_attr( $action ); ?>"
			data-plugin="<?php echo esc_attr( $data_plugin ); ?>">
			<i></i><?php echo esc_html( $title ); ?>
	<?php endif; ?>
	<?php
}

/**
 * Get the upgrade button.
 *
 * @since 1.8.2.2
 * @since 1.9.6.1 Add $license_level parameter.
 *
 * @param array  $utm           UTM parameters.
 * @param array  $classes       Classes.
 * @param string $license_level License level.
 */
function wpforms_edu_get_upgrade_button( $utm, $classes = [], $license_level = '' ) {

	$utm_medium  = isset( $utm['medium'] ) ? $utm['medium'] : '';
	$utm_content = isset( $utm['content'] ) ? $utm['content'] : '';

	$default_classes   = [ 'wpforms-btn', 'wpforms-btn-lg', 'wpforms-btn-orange' ];
	$default_classes[] = ! wpforms()->is_pro() ? 'wpforms-upgrade-modal' : '';

	$btn_classes = array_merge( $default_classes, (array) $classes );

	$upgrade_button_label = esc_html__( 'Upgrade to WPForms Pro', 'wpforms-lite' );

	if ( ! empty( $license_level ) && is_string( $license_level ) ) {
		$upgrade_button_label = sprintf(
			/* translators: %s: License name. */
			esc_html__( 'Upgrade to WPForms %s', 'wpforms-lite' ),
			esc_html( ucfirst( $license_level ) )
		);
	}
	?>
	<a
		href="<?php echo esc_url( wpforms_admin_upgrade_link( $utm_medium, $utm_content ) ); ?>"
		target="_blank"
		rel="noopener noreferrer"
		class="<?php echo esc_attr( implode( ' ', array_filter( $btn_classes ) ) ); ?>">
		<?php echo esc_html( $upgrade_button_label ); ?>
	</a>
	<?php
}

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
10.84 KB lrw-r--r-- 2026-05-28 15:16:52
Edit Download
1.38 KB lrw-r--r-- 2025-06-17 13:49:02
Edit Download
15.89 KB lrw-r--r-- 2026-03-19 16:20:18
Edit Download
3.97 KB lrw-r--r-- 2023-11-28 16:59:36
Edit Download
19.13 KB lrw-r--r-- 2025-11-06 19:10:44
Edit Download
2.82 KB lrw-r--r-- 2025-06-05 16:54:44
Edit Download
5.25 KB lrw-r--r-- 2025-08-11 13:38:06
Edit Download
2.89 KB lrw-r--r-- 2025-06-17 13:49:02
Edit Download
18.00 KB lrw-r--r-- 2026-06-03 16:18:22
Edit Download
8.79 KB lrw-r--r-- 2026-06-03 16:18:22
Edit Download
19.20 KB lrw-r--r-- 2026-03-19 16:20:18
Edit Download
14.56 KB lrw-r--r-- 2026-05-28 15:16:52
Edit Download
6.88 KB lrw-r--r-- 2024-06-13 16:24:36
Edit Download
21.76 KB lrw-r--r-- 2025-07-31 14:13:36
Edit Download
2.38 KB lrw-r--r-- 2025-06-05 16:54:44
Edit Download
2.52 KB lrw-r--r-- 2025-02-27 17:40:00
Edit Download
1.99 KB lrw-r--r-- 2025-06-05 16:54:44
Edit Download
10.43 KB lrw-r--r-- 2026-01-29 20:00:56
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).