' . 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' ), [ 'a' => [ 'href' => [], 'class' => [], 'target' => [], 'rel' => [], ], 'strong' => [], ] ), esc_url( wpforms_admin_upgrade_link( 'settings-license', 'Upgrade to WPForms Pro text Link' ) ) ) . '
'; $output .= '' . wp_kses( __( 'As a valued WPForms Lite user you receive 50% off, automatically applied at checkout!', 'wpforms-lite' ), [ 'strong' => [], ] ) . '
'; $output .= '' . esc_html__( 'Already purchased? Simply enter your license key below to enable WPForms PRO!', 'wpforms-lite' ) . '
'; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; /** * Filter license settings HTML output. * * @since 1.7.9 * * @param string $output HTML markup to be rendered in place of license settings. */ return apply_filters( 'wpforms_settings_license_output', $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 = [ 'value' => wpforms_setting( $args['id'], $default ), 'name' => wpforms_sanitize_key( $args['id'] ), ]; $data = ! empty( $args['data'] ) ? $args['data'] : []; if ( ! empty( $args['attr'] ) ) { $attr = array_merge( $attr, $args['attr'] ); } $output = sprintf( '', wpforms_html_attributes( $id, [], $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 = isset( $args['data'] ) ? (array) $args['data'] : []; $attr = isset( $args['attr'] ) ? (array) $args['attr'] : []; if ( $choices && ! empty( $args['search'] ) ) { $data['search'] = 'true'; } if ( ! empty( $args['placeholder'] ) ) { $data['placeholder'] = $args['placeholder']; } if ( $choices && ! empty( $args['multiple'] ) ) { $attr[] = 'multiple'; $select_name = $id . '[]'; } foreach ( $data as $name => $val ) { $data[ $name ] = 'data-' . sanitize_html_class( $name ) . '="' . esc_attr( $val ) . '"'; } $data = implode( ' ', $data ); $attr = implode( ' ', array_map( 'sanitize_html_class', $attr ) ); $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 ) : ''; $disabled = ! empty( $args['disabled'] ) ? ' disabled' : ''; $output = ''; if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } if ( ! empty( $args['disabled_desc'] ) ) { $output .= '' . wp_kses_post( $args['disabled_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 .= ''; $output .= ''; $output .= ''; $output .= ''; $x ++; } if ( ! empty( $args['desc'] ) ) { $output .= '' . wp_kses_post( $args['desc'] ) . '
'; } return $output; } /** * Settings toggle field callback. * * @since 1.7.4 * * @param array $args Arguments. * * @return string */ function wpforms_settings_toggle_callback( $args ) { $value = wpforms_setting( $args['id'] ); $id = wpforms_sanitize_key( $args['id'] ); $class = ! empty( $args['control-class'] ) ? $args['control-class'] : ''; $class .= ! empty( $args['is-important'] ) ? ' wpforms-important' : ''; $input_attr = ! empty( $args['input-attr'] ) ? $args['input-attr'] : ''; $output = wpforms_panel_field_toggle_control( [ 'control-class' => $class, ], 'wpforms-setting-' . $id, $id, ! empty( $args['label'] ) ? $args['label'] : '', $value, $input_attr ); $desc_on = ! empty( $args['desc'] ) ? $args['desc'] : ''; $desc_on = ! empty( $args['desc-on'] ) ? $args['desc-on'] : $desc_on; $desc_off = ! empty( $args['desc-off'] ) ? $args['desc-off'] : ''; $output .= sprintf( '%2$s
', empty( $value ) && ! empty( $desc_off ) ? ' wpforms-hidden' : '', wp_kses_post( $desc_on ) ); if ( ! empty( $desc_off ) ) { $output .= sprintf( '%2$s
', empty( $value ) ? '' : ' wpforms-hidden', wp_kses_post( $desc_off ) ); } 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 .= ''; } $output .= ''; $output .= ''; if ( ! empty( $args['desc'] ) ) { $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'] ); $data = isset( $args['data'] ) ? (array) $args['data'] : []; foreach ( $data as $name => $val ) { $data[ $name ] = 'data-' . sanitize_html_class( $name ) . '="' . esc_attr( $val ) . '"'; } $data = implode( ' ', $data ); $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 = '