';
if ( ! empty( $args['name'] ) && empty( $args['no_label'] ) ) {
$output .= '';
$output .= '';
$output .= '';
}
$output .= '';
$output .= $field;
if ( ! empty( $args['desc_after'] ) ) {
$output .= '
' . esc_html__( 'You\'re using WPForms Lite - no license needed. Enjoy!', 'wpforms-lite' ) . ' 🙂
'; $output .= '' . sprintf( wp_kses( /* translators: %s - WPForms.com upgrade URL. */ __( 'To unlock more features consider upgrading to PRO.', 'wpforms-lite' ), array( 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array(), ), 'strong' => array(), ) ), esc_url( wpforms_admin_upgrade_link( 'settings-license' ) ) ) . '
'; $output .= '' . wp_kses( __( 'As a valued WPForms Lite user you receive 50% off, automatically applied at checkout!', 'wpforms-lite' ), array( 'strong' => array(), 'br' => array(), ) ) . '
'; $output .= '' . esc_html__( 'Already purchased? Simply enter your license key below to connect with WPForms PRO!', 'wpforms-lite' ) . '
'; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; return $output; } $key = wpforms_setting( 'key', '', 'wpforms_license' ); $type = wpforms_setting( 'type', '', 'wpforms_license' ); $output = ''; $output .= ''; // Offer option to deactivate the key. $class = empty( $key ) ? 'wpforms-hide' : ''; $output .= ''; // If we have previously looked up the license type, display it. $class = empty( $type ) ? 'wpforms-hide' : ''; $output .= '' . sprintf( /* translators: $s - license type. */ esc_html__( 'Your license key type is %s.', 'wpforms-lite' ), '' . esc_html( $type ) . '' ) . '
'; $output .= '' . wp_kses( __( 'If your license has been upgraded or is incorrect, click here to force a refresh.', 'wpforms-lite' ), array( 'a' => array( 'href' => array(), 'id' => array(), ), ) ) . '
'; return $output; } /** * Settings text input field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_text_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $value = wpforms_setting( $args['id'], $default ); $id = wpforms_sanitize_key( $args['id'] ); $output = ''; if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings number input field callback. * * @since 1.5.3 * * @param array $args Setting field arguments. * * @return string */ function wpforms_settings_number_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $id = 'wpforms-setting-' . wpforms_sanitize_key( $args['id'] ); $attr = array( 'value' => wpforms_setting( $args['id'], $default ), 'name' => wpforms_sanitize_key( $args['id'] ), ); $data = ! empty( $args['data'] ) ? $args['data'] : array(); if ( ! empty( $args['attr'] ) ) { $attr = array_merge( $attr, $args['attr'] ); } $output = sprintf( '', wpforms_html_attributes( $id, array(), $data, $attr ) ); if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings select field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_select_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $value = wpforms_setting( $args['id'], $default ); $id = wpforms_sanitize_key( $args['id'] ); $select_name = $id; $class = ! empty( $args['choicesjs'] ) ? 'choicesjs-select' : ''; $choices = ! empty( $args['choicesjs'] ) ? true : false; $data = ''; if ( $choices && ! empty( $args['search'] ) ) { $data .= ' data-search="true"'; } if ( ! empty( $args['placeholder'] ) ) { $data .= ' data-placeholder="' . esc_attr( $args['placeholder'] ) . '"'; } if ( $choices && ! empty( $args['multiple'] ) ) { $data .= ' multiple'; $select_name = $id . '[]'; } $output = $choices ? '' : ''; $output .= ''; $output .= $choices ? '' : ''; if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings checkbox field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_checkbox_callback( $args ) { $value = wpforms_setting( $args['id'] ); $id = wpforms_sanitize_key( $args['id'] ); $checked = ! empty( $value ) ? checked( 1, $value, false ) : ''; $output = ''; if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings radio field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_radio_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $value = wpforms_setting( $args['id'], $default ); $id = wpforms_sanitize_key( $args['id'] ); $output = ''; $x = 1; foreach ( $args['options'] as $option => $name ) { $checked = checked( $value, $option, false ); $output .= ''; $x ++; } if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings image upload field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_image_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $value = wpforms_setting( $args['id'], $default ); $id = wpforms_sanitize_key( $args['id'] ); $output = ''; if ( ! empty( $value ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings color picker field callback. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_color_callback( $args ) { $default = isset( $args['default'] ) ? esc_html( $args['default'] ) : ''; $value = wpforms_setting( $args['id'], $default ); $id = wpforms_sanitize_key( $args['id'] ); $output = ''; if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings providers field callback - this is for the Integrations tab. * * @since 1.3.9 * * @param array $args * * @return string */ function wpforms_settings_providers_callback( $args ) { $active = wpforms_get_providers_available(); $providers = wpforms_get_providers_options(); $output = '