PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.9.1.2
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.9.1.2
1.10.1.1 1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / includes / functions / education.php
wpforms-lite / includes / functions Last commit date
access.php 1 year ago checks.php 1 year ago colors.php 1 year ago data-presets.php 1 year ago date-time.php 1 year ago debug.php 1 year ago education.php 1 year ago escape-sanitize.php 1 year ago filesystem-media.php 1 year ago form-fields.php 1 year ago forms.php 1 year ago list.php 1 year ago payments.php 1 year ago plugins.php 1 year ago privacy.php 1 year ago providers.php 1 year ago unused.php 1 year ago utilities.php 1 year ago
education.php
83 lines
1 <?php
2 /**
3 * Helpers functions for the Education pages.
4 *
5 * @since 1.8.2.2
6 */
7
8 /**
9 * Get the button.
10 *
11 * @since 1.8.2.2
12 *
13 * @param string $action Action to perform.
14 * @param bool $plugin_allow Is plugin allowed.
15 * @param string $path Plugin file.
16 * @param string $url URL for download plugin.
17 * @param array $utm UTM parameters.
18 */
19 function wpforms_edu_get_button( $action, $plugin_allow, $path, $url, $utm ) {
20
21 // If the user is not allowed to use the plugin, show the upgrade button.
22 if ( ! $plugin_allow ) {
23 wpforms_edu_get_upgrade_button( $utm );
24
25 return;
26 }
27
28 $status = 'inactive';
29 $data_plugin = $path;
30 $title = esc_html__( 'Activate', 'wpforms-lite' );
31 $can_install = wpforms_can_install( 'addon' );
32
33 if ( $action === 'install' ) {
34 $status = 'download';
35 $data_plugin = $url;
36 $title = esc_html__( 'Install & Activate', 'wpforms-lite' );
37 }
38
39 ?>
40
41 <?php if ( $action === 'install' && ! $can_install ) : ?>
42 <div class="wpforms-notice wpforms-error">
43 <p><?php esc_html_e( 'Plugin installation is disabled for this site.', 'wpforms-lite' ); ?></p>
44 </div>
45 <?php else : ?>
46 <button
47 class="status-<?php echo esc_attr( $status ); ?> wpforms-btn wpforms-btn-lg wpforms-btn-blue wpforms-education-toggle-plugin-btn"
48 data-type="addon"
49 data-action="<?php echo esc_attr( $action ); ?>"
50 data-plugin="<?php echo esc_attr( $data_plugin ); ?>">
51 <i></i><?php echo esc_html( $title ); ?>
52 <?php endif; ?>
53 <?php
54 }
55
56 /**
57 * Get the upgrade button.
58 *
59 * @since 1.8.2.2
60 *
61 * @param array $utm UTM parameters.
62 * @param array $classes Classes.
63 */
64 function wpforms_edu_get_upgrade_button( $utm, $classes = [] ) {
65
66 $utm_medium = isset( $utm['medium'] ) ? $utm['medium'] : '';
67 $utm_content = isset( $utm['content'] ) ? $utm['content'] : '';
68
69 $default_classes = [ 'wpforms-btn', 'wpforms-btn-lg', 'wpforms-btn-orange' ];
70 $default_classes[] = ! wpforms()->is_pro() ? 'wpforms-upgrade-modal' : '';
71
72 $btn_classes = array_merge( $default_classes, (array) $classes );
73 ?>
74 <a
75 href="<?php echo esc_url( wpforms_admin_upgrade_link( $utm_medium, $utm_content ) ); ?>"
76 target="_blank"
77 rel="noopener noreferrer"
78 class="<?php echo esc_attr( implode( ' ', array_filter( $btn_classes ) ) ); ?>">
79 <?php esc_html_e( 'Upgrade to WPForms Pro', 'wpforms-lite' ); ?>
80 </a>
81 <?php
82 }
83