form-01--form-container.php
3 years ago
form-02--form-fields.php
3 years ago
form-03--input.php
5 months ago
form-04--select2.php
5 months ago
form-05--select2-dropdown.php
3 years ago
form-06--timepicker-dropdown.php
3 years ago
form-07--radio.php
5 months ago
form-08--checkbox.php
5 months ago
form-09--calendar.php
3 years ago
form-10--submit.php
5 months ago
form-11--options-container.php
3 years ago
form-12--options-title.php
5 months ago
form-13--gdpr.php
5 months ago
form-14--error-message.php
5 months ago
form-15--success-message.php
2 years ago
form-16--recaptcha.php
5 months ago
general-01--module-container.php
3 years ago
general-02--main-layout.php
1 month ago
general-03--layout-header.php
3 years ago
general-04--layout-content.php
3 years ago
general-05--layout-footer.php
3 years ago
general-06--image-size.php
5 months ago
general-07--image-fitting.php
3 years ago
general-08--image-position.php
5 months ago
general-09--content-wrapper.php
3 years ago
general-10--title.php
5 months ago
general-11--subtitle.php
5 months ago
general-12--content.php
5 months ago
general-13--cta-container.php
3 years ago
general-14--cta-button.php
5 months ago
general-15--cta-alignment.php
3 years ago
general-16--nsa-link.php
5 months ago
general-17--close-button.php
3 years ago
general-18--popup-mask.php
3 years ago
general-19--cta-helper-text.php
5 months ago
module-size-embed.php
5 months ago
module-size-popup.php
5 months ago
module-size-slidein.php
3 years ago
form-12--options-title.php
111 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Title custom settings. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.3.0 |
| 7 | */ |
| 8 | |
| 9 | global $wp_locale; |
| 10 | |
| 11 | $is_rtl = $wp_locale->is_rtl(); |
| 12 | |
| 13 | $component = '.hustle-form .hustle-form-options .hustle-group-title'; |
| 14 | |
| 15 | // SETTINGS: Font settings. |
| 16 | $color = $colors['optin_mailchimp_title_color']; |
| 17 | $font_family = $typography['form_extras_font_family']; |
| 18 | $font_size = $typography['form_extras_font_size'] . $typography['form_extras_font_size_unit']; |
| 19 | $font_weight = $typography['form_extras_font_weight']; |
| 20 | $font_style = 'normal'; |
| 21 | $alignment = ( ! $is_rtl ) ? $typography['form_extras_alignment'] : 'right'; |
| 22 | $line_height = $typography['form_extras_line_height'] . $typography['form_extras_line_height_unit']; |
| 23 | $letter_spacing = $typography['form_extras_letter_spacing'] . $typography['form_extras_letter_spacing_unit']; |
| 24 | $text_transform = $typography['form_extras_text_transform']; |
| 25 | $text_decoration = $typography['form_extras_text_decoration']; |
| 26 | |
| 27 | if ( 'custom' === $font_family ) { |
| 28 | $font_family = ( '' !== $typography['error_message_custom_font_family'] ) ? $typography['error_message_custom_font_family'] : 'inherit'; |
| 29 | } |
| 30 | |
| 31 | if ( 'regular' === $font_weight ) { |
| 32 | $font_weight = 'normal'; |
| 33 | } elseif ( 'italic' === $font_weight ) { |
| 34 | $font_weight = 'normal'; |
| 35 | $font_style = 'italic'; |
| 36 | } elseif ( preg_match( '/(italic)/', $font_weight ) ) { // Check if font weight is italic. |
| 37 | $font_weight = str_replace( 'italic', '', $font_weight ); |
| 38 | $font_style = 'italic'; |
| 39 | } |
| 40 | |
| 41 | $mobile_font_size = ( '' !== $typography['form_extras_font_size_mobile'] ) ? $typography['form_extras_font_size_mobile'] . $typography['form_extras_font_size_unit_mobile'] : $font_size; |
| 42 | $mobile_font_weight = $typography['form_extras_font_weight_mobile']; |
| 43 | $mobile_font_style = 'normal'; |
| 44 | $mobile_alignment = ( ! $is_rtl ) ? $typography['form_extras_alignment_mobile'] : 'right'; |
| 45 | $mobile_line_height = ( '' !== $typography['form_extras_line_height_mobile'] ) ? $typography['form_extras_line_height_mobile'] . $typography['form_extras_line_height_unit_mobile'] : $line_height; |
| 46 | $mobile_letter_spacing = ( '' !== $typography['form_extras_letter_spacing_mobile'] ) ? $typography['form_extras_letter_spacing_mobile'] . $typography['form_extras_letter_spacing_unit_mobile'] : $letter_spacing; |
| 47 | $mobile_text_transform = $typography['form_extras_text_transform']; |
| 48 | $mobile_text_decoration = $typography['form_extras_text_decoration_mobile']; |
| 49 | |
| 50 | if ( 'regular' === $mobile_font_weight ) { |
| 51 | $mobile_font_weight = 'normal'; |
| 52 | } elseif ( 'italic' === $font_weight ) { |
| 53 | $font_weight = 'normal'; |
| 54 | $font_style = 'italic'; |
| 55 | } elseif ( preg_match( '/(italic)/', $mobile_font_weight ) ) { // Check if font weight is italic. |
| 56 | $mobile_font_weight = str_replace( 'italic', '', $mobile_font_weight ); |
| 57 | $mobile_font_style = 'italic'; |
| 58 | } |
| 59 | |
| 60 | if ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_typography ) ) { |
| 61 | $mobile_font_size = $font_size; |
| 62 | $mobile_font_weight = $font_weight; |
| 63 | $mobile_font_style = $font_style; |
| 64 | $mobile_alignment = $alignment; |
| 65 | $mobile_line_height = $line_height; |
| 66 | $mobile_letter_spacing = $letter_spacing; |
| 67 | $mobile_text_transform = $text_transform; |
| 68 | $mobile_text_decoration = $text_decoration; |
| 69 | } |
| 70 | |
| 71 | // ================================================== |
| 72 | // Check if is an opt-in module. |
| 73 | if ( $is_optin ) { |
| 74 | |
| 75 | $style .= ' '; |
| 76 | |
| 77 | // Mobile styles. |
| 78 | $style .= $prefix_mobile . $component . ' {'; |
| 79 | $style .= 'display: block;'; |
| 80 | $style .= 'margin: 0 0 20px;'; |
| 81 | $style .= 'padding: 0;'; |
| 82 | $style .= 'border: 0;'; |
| 83 | $style .= ( ! $is_vanilla ) ? 'color: ' . $color . ';' : ''; |
| 84 | $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : ''; |
| 85 | $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : ''; |
| 86 | $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : ''; |
| 87 | $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : ''; |
| 88 | $style .= 'font-style: ' . $mobile_font_style . ';'; |
| 89 | $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';'; |
| 90 | $style .= 'text-transform: ' . $mobile_text_transform . ';'; |
| 91 | $style .= 'text-decoration: ' . $mobile_text_decoration . ';'; |
| 92 | $style .= 'text-align: ' . $mobile_alignment . ';'; |
| 93 | $style .= '}'; |
| 94 | |
| 95 | // Desktop styles. |
| 96 | $style .= $breakpoint . ' {'; |
| 97 | $style .= $prefix_desktop . $component . ' {'; |
| 98 | $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : ''; |
| 99 | $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : ''; |
| 100 | $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : ''; |
| 101 | $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : ''; |
| 102 | $style .= 'font-style: ' . $font_style . ';'; |
| 103 | $style .= 'letter-spacing: ' . $letter_spacing . ';'; |
| 104 | $style .= 'text-transform: ' . $text_transform . ';'; |
| 105 | $style .= 'text-decoration: ' . $text_decoration . ';'; |
| 106 | $style .= 'text-align: ' . $alignment . ';'; |
| 107 | $style .= '}'; |
| 108 | $style .= '}'; |
| 109 | |
| 110 | } |
| 111 |