@@ -7,117 +7,117 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; |
|
| 10 | + exit; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) : |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Returns an array of the layout panel. |
|
| 17 | - * |
|
| 18 | - * @package lsx |
|
| 19 | - * @subpackage customizer |
|
| 20 | - * |
|
| 21 | - * @return $lsx_controls array() |
|
| 22 | - */ |
|
| 23 | - function lsx_customizer_layout_controls( $lsx_controls ) { |
|
| 24 | - $lsx_controls['sections']['lsx-layout'] = array( |
|
| 25 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
| 26 | - 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
| 27 | - 'priority' => 22, |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 31 | - 'default' => false, |
|
| 32 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 33 | - 'transport' => 'postMessage', |
|
| 34 | - ); |
|
| 35 | - |
|
| 36 | - $lsx_controls['fields']['lsx_header_fixed'] = array( |
|
| 37 | - 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
| 38 | - 'section' => 'lsx-layout', |
|
| 39 | - 'type' => 'checkbox', |
|
| 40 | - ); |
|
| 41 | - |
|
| 42 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 43 | - 'default' => false, |
|
| 44 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 45 | - 'transport' => 'postMessage', |
|
| 46 | - ); |
|
| 47 | - |
|
| 48 | - $lsx_controls['fields']['lsx_header_search'] = array( |
|
| 49 | - 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
| 50 | - 'section' => 'lsx-layout', |
|
| 51 | - 'type' => 'checkbox', |
|
| 52 | - ); |
|
| 53 | - |
|
| 54 | - $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
|
| 55 | - 'selector' => '#lsx-header-search-css', |
|
| 56 | - 'render_callback' => function() { |
|
| 57 | - $search_form = get_theme_mod( 'lsx_header_search' ); |
|
| 58 | - |
|
| 59 | - if ( false !== $search_form ) { |
|
| 60 | - echo 'body #searchform { display: block; }'; |
|
| 61 | - } else { |
|
| 62 | - echo 'body #searchform { display: none; }'; |
|
| 63 | - } |
|
| 64 | - }, |
|
| 65 | - ); |
|
| 66 | - |
|
| 67 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 68 | - 'default' => 'inline', |
|
| 69 | - 'type' => 'theme_mod', |
|
| 70 | - 'transport' => 'postMessage', |
|
| 71 | - ); |
|
| 72 | - |
|
| 73 | - $lsx_controls['fields']['lsx_header_layout'] = array( |
|
| 74 | - 'label' => esc_html__( 'Header', 'lsx' ), |
|
| 75 | - 'section' => 'lsx-layout', |
|
| 76 | - 'control' => 'LSX_Customize_Header_Layout_Control', |
|
| 77 | - 'choices' => array( |
|
| 78 | - 'central', |
|
| 79 | - 'expanded', |
|
| 80 | - 'inline', |
|
| 81 | - ), |
|
| 82 | - ); |
|
| 83 | - |
|
| 84 | - $lsx_controls['settings']['lsx_header_mobile_layout'] = array( |
|
| 85 | - 'default' => 'navigation-bar', |
|
| 86 | - 'type' => 'theme_mod', |
|
| 87 | - 'transport' => 'postMessage', |
|
| 88 | - ); |
|
| 89 | - |
|
| 90 | - $lsx_controls['fields']['lsx_header_mobile_layout'] = array( |
|
| 91 | - 'label' => esc_html__( 'Mobile Header', 'lsx' ), |
|
| 92 | - 'section' => 'lsx-layout', |
|
| 93 | - 'control' => 'LSX_Customize_Mobile_Header_Layout_Control', |
|
| 94 | - 'choices' => array( |
|
| 95 | - 'navigation-bar', |
|
| 96 | - 'hamburger', |
|
| 97 | - ), |
|
| 98 | - ); |
|
| 99 | - |
|
| 100 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
| 101 | - 'default' => '1c', |
|
| 102 | - 'type' => 'theme_mod', |
|
| 103 | - 'transport' => 'refresh', |
|
| 104 | - ); |
|
| 105 | - |
|
| 106 | - $lsx_controls['fields']['lsx_layout'] = array( |
|
| 107 | - 'label' => esc_html__( 'Body', 'lsx' ), |
|
| 108 | - 'section' => 'lsx-layout', |
|
| 109 | - 'control' => 'LSX_Customize_Layout_Control', |
|
| 110 | - 'choices' => array( |
|
| 111 | - '1c', |
|
| 112 | - '2cr', |
|
| 113 | - '2cl', |
|
| 114 | - ), |
|
| 115 | - ); |
|
| 116 | - |
|
| 117 | - $lsx_controls = apply_filters( 'lsx_layout_customizer_controls', $lsx_controls ); |
|
| 118 | - |
|
| 119 | - return $lsx_controls; |
|
| 120 | - } |
|
| 15 | + /** |
|
| 16 | + * Returns an array of the layout panel. |
|
| 17 | + * |
|
| 18 | + * @package lsx |
|
| 19 | + * @subpackage customizer |
|
| 20 | + * |
|
| 21 | + * @return $lsx_controls array() |
|
| 22 | + */ |
|
| 23 | + function lsx_customizer_layout_controls( $lsx_controls ) { |
|
| 24 | + $lsx_controls['sections']['lsx-layout'] = array( |
|
| 25 | + 'title' => esc_html__( 'Layout', 'lsx' ), |
|
| 26 | + 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
| 27 | + 'priority' => 22, |
|
| 28 | + ); |
|
| 29 | + |
|
| 30 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 31 | + 'default' => false, |
|
| 32 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 33 | + 'transport' => 'postMessage', |
|
| 34 | + ); |
|
| 35 | + |
|
| 36 | + $lsx_controls['fields']['lsx_header_fixed'] = array( |
|
| 37 | + 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
| 38 | + 'section' => 'lsx-layout', |
|
| 39 | + 'type' => 'checkbox', |
|
| 40 | + ); |
|
| 41 | + |
|
| 42 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 43 | + 'default' => false, |
|
| 44 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 45 | + 'transport' => 'postMessage', |
|
| 46 | + ); |
|
| 47 | + |
|
| 48 | + $lsx_controls['fields']['lsx_header_search'] = array( |
|
| 49 | + 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
| 50 | + 'section' => 'lsx-layout', |
|
| 51 | + 'type' => 'checkbox', |
|
| 52 | + ); |
|
| 53 | + |
|
| 54 | + $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
|
| 55 | + 'selector' => '#lsx-header-search-css', |
|
| 56 | + 'render_callback' => function() { |
|
| 57 | + $search_form = get_theme_mod( 'lsx_header_search' ); |
|
| 58 | + |
|
| 59 | + if ( false !== $search_form ) { |
|
| 60 | + echo 'body #searchform { display: block; }'; |
|
| 61 | + } else { |
|
| 62 | + echo 'body #searchform { display: none; }'; |
|
| 63 | + } |
|
| 64 | + }, |
|
| 65 | + ); |
|
| 66 | + |
|
| 67 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 68 | + 'default' => 'inline', |
|
| 69 | + 'type' => 'theme_mod', |
|
| 70 | + 'transport' => 'postMessage', |
|
| 71 | + ); |
|
| 72 | + |
|
| 73 | + $lsx_controls['fields']['lsx_header_layout'] = array( |
|
| 74 | + 'label' => esc_html__( 'Header', 'lsx' ), |
|
| 75 | + 'section' => 'lsx-layout', |
|
| 76 | + 'control' => 'LSX_Customize_Header_Layout_Control', |
|
| 77 | + 'choices' => array( |
|
| 78 | + 'central', |
|
| 79 | + 'expanded', |
|
| 80 | + 'inline', |
|
| 81 | + ), |
|
| 82 | + ); |
|
| 83 | + |
|
| 84 | + $lsx_controls['settings']['lsx_header_mobile_layout'] = array( |
|
| 85 | + 'default' => 'navigation-bar', |
|
| 86 | + 'type' => 'theme_mod', |
|
| 87 | + 'transport' => 'postMessage', |
|
| 88 | + ); |
|
| 89 | + |
|
| 90 | + $lsx_controls['fields']['lsx_header_mobile_layout'] = array( |
|
| 91 | + 'label' => esc_html__( 'Mobile Header', 'lsx' ), |
|
| 92 | + 'section' => 'lsx-layout', |
|
| 93 | + 'control' => 'LSX_Customize_Mobile_Header_Layout_Control', |
|
| 94 | + 'choices' => array( |
|
| 95 | + 'navigation-bar', |
|
| 96 | + 'hamburger', |
|
| 97 | + ), |
|
| 98 | + ); |
|
| 99 | + |
|
| 100 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
| 101 | + 'default' => '1c', |
|
| 102 | + 'type' => 'theme_mod', |
|
| 103 | + 'transport' => 'refresh', |
|
| 104 | + ); |
|
| 105 | + |
|
| 106 | + $lsx_controls['fields']['lsx_layout'] = array( |
|
| 107 | + 'label' => esc_html__( 'Body', 'lsx' ), |
|
| 108 | + 'section' => 'lsx-layout', |
|
| 109 | + 'control' => 'LSX_Customize_Layout_Control', |
|
| 110 | + 'choices' => array( |
|
| 111 | + '1c', |
|
| 112 | + '2cr', |
|
| 113 | + '2cl', |
|
| 114 | + ), |
|
| 115 | + ); |
|
| 116 | + |
|
| 117 | + $lsx_controls = apply_filters( 'lsx_layout_customizer_controls', $lsx_controls ); |
|
| 118 | + |
|
| 119 | + return $lsx_controls; |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | 122 | endif; |
| 123 | 123 | |
@@ -125,126 +125,126 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | if ( ! function_exists( 'lsx_customizer_template_cover_controls' ) ) : |
| 127 | 127 | |
| 128 | - /** |
|
| 129 | - * Returns an array of the Cover Template panel. |
|
| 130 | - * |
|
| 131 | - * @package lsx |
|
| 132 | - * @subpackage customizer |
|
| 133 | - * |
|
| 134 | - * @return $lsx_controls array() |
|
| 135 | - */ |
|
| 136 | - function lsx_customizer_template_cover_controls( $lsx_controls ) { |
|
| 137 | - $lsx_controls['sections']['lsx-cover-template'] = array( |
|
| 138 | - 'title' => esc_html__( 'Cover Template Settings', 'lsx' ), |
|
| 139 | - 'description' => esc_html__( 'Change the cover template settings.', 'lsx' ), |
|
| 140 | - 'priority' => 23, |
|
| 141 | - ); |
|
| 142 | - |
|
| 143 | - $lsx_controls['settings']['lsx_cover_template_alt_logo'] = array( |
|
| 144 | - 'default' => '', |
|
| 145 | - 'type' => 'theme_mod', |
|
| 146 | - 'transport' => 'postMessage', |
|
| 147 | - 'capability' => 'edit_theme_options', |
|
| 148 | - 'sanitize_callback' => 'absint' |
|
| 149 | - ); |
|
| 150 | - |
|
| 151 | - $lsx_controls['fields']['lsx_cover_template_alt_logo'] = array( |
|
| 152 | - 'label' => esc_html__( 'Upload Alternative Logo Image', 'lsx' ), |
|
| 153 | - 'description' => __( 'Upload an alternative logo image (svg, png or jpg).', 'lsx' ), |
|
| 154 | - 'section' => 'lsx-cover-template', |
|
| 155 | - 'control' => 'WP_Customize_Media_Control', |
|
| 156 | - 'mime_type' => 'image', |
|
| 157 | - ); |
|
| 158 | - |
|
| 159 | - $lsx_controls['settings']['lsx_cover_template_fixed_background'] = array( |
|
| 160 | - 'default' => '', |
|
| 161 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 162 | - 'transport' => 'postMessage', |
|
| 163 | - ); |
|
| 164 | - |
|
| 165 | - $lsx_controls['fields']['lsx_cover_template_fixed_background'] = array( |
|
| 166 | - 'label' => esc_html__( 'Fixed Background Image', 'lsx' ), |
|
| 167 | - 'section' => 'lsx-cover-template', |
|
| 168 | - 'type' => 'checkbox', |
|
| 169 | - ); |
|
| 170 | - |
|
| 171 | - $lsx_controls['settings']['lsx_cover_template_cover_background_color'] = array( |
|
| 172 | - 'default' => '#000000', |
|
| 173 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
| 174 | - 'type' => 'theme_mod', |
|
| 175 | - 'transport' => 'postMessage', |
|
| 176 | - ); |
|
| 177 | - |
|
| 178 | - $lsx_controls['fields']['lsx_cover_template_cover_background_color'] = array( |
|
| 179 | - 'label' => esc_html__( 'Cover Background Colour', 'lsx' ), |
|
| 180 | - 'description' => __( 'The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx' ), |
|
| 181 | - 'section' => 'lsx-cover-template', |
|
| 182 | - 'control' => 'WP_Customize_Color_Control', |
|
| 183 | - ); |
|
| 184 | - |
|
| 185 | - $lsx_controls['settings']['lsx_cover_template_overlay_background_color'] = array( |
|
| 186 | - 'default' => '#000000', |
|
| 187 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
| 188 | - 'type' => 'theme_mod', |
|
| 189 | - 'transport' => 'postMessage', |
|
| 190 | - ); |
|
| 191 | - |
|
| 192 | - $lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array( |
|
| 193 | - 'label' => esc_html__( 'Overlay Background Colour', 'lsx' ), |
|
| 194 | - 'description' => __( 'The colour used for the overlay. Defaults to black.', 'lsx' ), |
|
| 195 | - 'section' => 'lsx-cover-template', |
|
| 196 | - 'control' => 'WP_Customize_Color_Control', |
|
| 197 | - ); |
|
| 198 | - |
|
| 199 | - $lsx_controls['settings']['lsx_cover_template_overlay_text_color'] = array( |
|
| 200 | - 'default' => '#ffffff', |
|
| 201 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
| 202 | - 'type' => 'theme_mod', |
|
| 203 | - 'transport' => 'postMessage', |
|
| 204 | - ); |
|
| 205 | - |
|
| 206 | - $lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = ( |
|
| 207 | - array( |
|
| 208 | - 'label' => __( 'Overlay Text Colour', 'lsx' ), |
|
| 209 | - 'description' => __( 'The colour used for the text in the overlay.', 'lsx' ), |
|
| 210 | - 'section' => 'lsx-cover-template', |
|
| 211 | - 'control' => 'WP_Customize_Color_Control', |
|
| 212 | - ) |
|
| 213 | - ); |
|
| 214 | - |
|
| 215 | - $lsx_controls['settings']['lsx_cover_template_menu_text_color'] = array( |
|
| 216 | - 'default' => '#ffffff', |
|
| 217 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
| 218 | - 'type' => 'theme_mod', |
|
| 219 | - 'transport' => 'postMessage', |
|
| 220 | - ); |
|
| 221 | - |
|
| 222 | - $lsx_controls['fields']['lsx_cover_template_menu_text_color'] = ( |
|
| 223 | - array( |
|
| 224 | - 'label' => __( 'Menu Text Colour', 'lsx' ), |
|
| 225 | - 'description' => __( 'The colour used for the text in the nav menu.', 'lsx' ), |
|
| 226 | - 'section' => 'lsx-cover-template', |
|
| 227 | - 'control' => 'WP_Customize_Color_Control', |
|
| 228 | - ) |
|
| 229 | - ); |
|
| 230 | - |
|
| 231 | - $lsx_controls['settings']['lsx_cover_template_overlay_opacity'] = array( |
|
| 232 | - 'default' => 80, |
|
| 233 | - 'sanitize_callback' => 'absint', |
|
| 234 | - 'transport' => 'postMessage', |
|
| 235 | - ); |
|
| 236 | - |
|
| 237 | - $lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = ( |
|
| 238 | - array( |
|
| 239 | - 'label' => __( 'Overlay Opacity', 'lsx' ), |
|
| 240 | - 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ), |
|
| 241 | - 'section' => 'lsx-cover-template', |
|
| 242 | - 'type' => 'range', |
|
| 243 | - ) |
|
| 244 | - ); |
|
| 245 | - |
|
| 246 | - return $lsx_controls; |
|
| 247 | - } |
|
| 128 | + /** |
|
| 129 | + * Returns an array of the Cover Template panel. |
|
| 130 | + * |
|
| 131 | + * @package lsx |
|
| 132 | + * @subpackage customizer |
|
| 133 | + * |
|
| 134 | + * @return $lsx_controls array() |
|
| 135 | + */ |
|
| 136 | + function lsx_customizer_template_cover_controls( $lsx_controls ) { |
|
| 137 | + $lsx_controls['sections']['lsx-cover-template'] = array( |
|
| 138 | + 'title' => esc_html__( 'Cover Template Settings', 'lsx' ), |
|
| 139 | + 'description' => esc_html__( 'Change the cover template settings.', 'lsx' ), |
|
| 140 | + 'priority' => 23, |
|
| 141 | + ); |
|
| 142 | + |
|
| 143 | + $lsx_controls['settings']['lsx_cover_template_alt_logo'] = array( |
|
| 144 | + 'default' => '', |
|
| 145 | + 'type' => 'theme_mod', |
|
| 146 | + 'transport' => 'postMessage', |
|
| 147 | + 'capability' => 'edit_theme_options', |
|
| 148 | + 'sanitize_callback' => 'absint' |
|
| 149 | + ); |
|
| 150 | + |
|
| 151 | + $lsx_controls['fields']['lsx_cover_template_alt_logo'] = array( |
|
| 152 | + 'label' => esc_html__( 'Upload Alternative Logo Image', 'lsx' ), |
|
| 153 | + 'description' => __( 'Upload an alternative logo image (svg, png or jpg).', 'lsx' ), |
|
| 154 | + 'section' => 'lsx-cover-template', |
|
| 155 | + 'control' => 'WP_Customize_Media_Control', |
|
| 156 | + 'mime_type' => 'image', |
|
| 157 | + ); |
|
| 158 | + |
|
| 159 | + $lsx_controls['settings']['lsx_cover_template_fixed_background'] = array( |
|
| 160 | + 'default' => '', |
|
| 161 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
| 162 | + 'transport' => 'postMessage', |
|
| 163 | + ); |
|
| 164 | + |
|
| 165 | + $lsx_controls['fields']['lsx_cover_template_fixed_background'] = array( |
|
| 166 | + 'label' => esc_html__( 'Fixed Background Image', 'lsx' ), |
|
| 167 | + 'section' => 'lsx-cover-template', |
|
| 168 | + 'type' => 'checkbox', |
|
| 169 | + ); |
|
| 170 | + |
|
| 171 | + $lsx_controls['settings']['lsx_cover_template_cover_background_color'] = array( |
|
| 172 | + 'default' => '#000000', |
|
| 173 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
| 174 | + 'type' => 'theme_mod', |
|
| 175 | + 'transport' => 'postMessage', |
|
| 176 | + ); |
|
| 177 | + |
|
| 178 | + $lsx_controls['fields']['lsx_cover_template_cover_background_color'] = array( |
|
| 179 | + 'label' => esc_html__( 'Cover Background Colour', 'lsx' ), |
|
| 180 | + 'description' => __( 'The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx' ), |
|
| 181 | + 'section' => 'lsx-cover-template', |
|
| 182 | + 'control' => 'WP_Customize_Color_Control', |
|
| 183 | + ); |
|
| 184 | + |
|
| 185 | + $lsx_controls['settings']['lsx_cover_template_overlay_background_color'] = array( |
|
| 186 | + 'default' => '#000000', |
|
| 187 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
| 188 | + 'type' => 'theme_mod', |
|
| 189 | + 'transport' => 'postMessage', |
|
| 190 | + ); |
|
| 191 | + |
|
| 192 | + $lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array( |
|
| 193 | + 'label' => esc_html__( 'Overlay Background Colour', 'lsx' ), |
|
| 194 | + 'description' => __( 'The colour used for the overlay. Defaults to black.', 'lsx' ), |
|
| 195 | + 'section' => 'lsx-cover-template', |
|
| 196 | + 'control' => 'WP_Customize_Color_Control', |
|
| 197 | + ); |
|
| 198 | + |
|
| 199 | + $lsx_controls['settings']['lsx_cover_template_overlay_text_color'] = array( |
|
| 200 | + 'default' => '#ffffff', |
|
| 201 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
| 202 | + 'type' => 'theme_mod', |
|
| 203 | + 'transport' => 'postMessage', |
|
| 204 | + ); |
|
| 205 | + |
|
| 206 | + $lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = ( |
|
| 207 | + array( |
|
| 208 | + 'label' => __( 'Overlay Text Colour', 'lsx' ), |
|
| 209 | + 'description' => __( 'The colour used for the text in the overlay.', 'lsx' ), |
|
| 210 | + 'section' => 'lsx-cover-template', |
|
| 211 | + 'control' => 'WP_Customize_Color_Control', |
|
| 212 | + ) |
|
| 213 | + ); |
|
| 214 | + |
|
| 215 | + $lsx_controls['settings']['lsx_cover_template_menu_text_color'] = array( |
|
| 216 | + 'default' => '#ffffff', |
|
| 217 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
| 218 | + 'type' => 'theme_mod', |
|
| 219 | + 'transport' => 'postMessage', |
|
| 220 | + ); |
|
| 221 | + |
|
| 222 | + $lsx_controls['fields']['lsx_cover_template_menu_text_color'] = ( |
|
| 223 | + array( |
|
| 224 | + 'label' => __( 'Menu Text Colour', 'lsx' ), |
|
| 225 | + 'description' => __( 'The colour used for the text in the nav menu.', 'lsx' ), |
|
| 226 | + 'section' => 'lsx-cover-template', |
|
| 227 | + 'control' => 'WP_Customize_Color_Control', |
|
| 228 | + ) |
|
| 229 | + ); |
|
| 230 | + |
|
| 231 | + $lsx_controls['settings']['lsx_cover_template_overlay_opacity'] = array( |
|
| 232 | + 'default' => 80, |
|
| 233 | + 'sanitize_callback' => 'absint', |
|
| 234 | + 'transport' => 'postMessage', |
|
| 235 | + ); |
|
| 236 | + |
|
| 237 | + $lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = ( |
|
| 238 | + array( |
|
| 239 | + 'label' => __( 'Overlay Opacity', 'lsx' ), |
|
| 240 | + 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ), |
|
| 241 | + 'section' => 'lsx-cover-template', |
|
| 242 | + 'type' => 'range', |
|
| 243 | + ) |
|
| 244 | + ); |
|
| 245 | + |
|
| 246 | + return $lsx_controls; |
|
| 247 | + } |
|
| 248 | 248 | |
| 249 | 249 | endif; |
| 250 | 250 | |
@@ -253,19 +253,19 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | if ( ! function_exists( 'lsx_get_customizer_controls' ) ) : |
| 255 | 255 | |
| 256 | - /** |
|
| 257 | - * Returns an array of $controls for the customizer class to generate. |
|
| 258 | - * |
|
| 259 | - * @package lsx |
|
| 260 | - * @subpackage customizer |
|
| 261 | - * |
|
| 262 | - * @return $lsx_controls array() |
|
| 263 | - */ |
|
| 264 | - function lsx_get_customizer_controls() { |
|
| 265 | - $lsx_controls = array(); |
|
| 266 | - $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
| 267 | - return $lsx_controls; |
|
| 268 | - } |
|
| 256 | + /** |
|
| 257 | + * Returns an array of $controls for the customizer class to generate. |
|
| 258 | + * |
|
| 259 | + * @package lsx |
|
| 260 | + * @subpackage customizer |
|
| 261 | + * |
|
| 262 | + * @return $lsx_controls array() |
|
| 263 | + */ |
|
| 264 | + function lsx_get_customizer_controls() { |
|
| 265 | + $lsx_controls = array(); |
|
| 266 | + $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
| 267 | + return $lsx_controls; |
|
| 268 | + } |
|
| 269 | 269 | |
| 270 | 270 | endif; |
| 271 | 271 | |
@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | * @subpackage customizer |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) : |
|
| 13 | +if ( ! function_exists('lsx_customizer_layout_controls')) : |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Returns an array of the layout panel. |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @return $lsx_controls array() |
| 22 | 22 | */ |
| 23 | - function lsx_customizer_layout_controls( $lsx_controls ) { |
|
| 23 | + function lsx_customizer_layout_controls($lsx_controls) { |
|
| 24 | 24 | $lsx_controls['sections']['lsx-layout'] = array( |
| 25 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
| 26 | - 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
| 25 | + 'title' => esc_html__('Layout', 'lsx'), |
|
| 26 | + 'description' => esc_html__('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'), |
|
| 27 | 27 | 'priority' => 22, |
| 28 | 28 | ); |
| 29 | 29 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
| 37 | - 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
| 37 | + 'label' => esc_html__('Fixed Header', 'lsx'), |
|
| 38 | 38 | 'section' => 'lsx-layout', |
| 39 | 39 | 'type' => 'checkbox', |
| 40 | 40 | ); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | 48 | $lsx_controls['fields']['lsx_header_search'] = array( |
| 49 | - 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
| 49 | + 'label' => esc_html__('Search Box in Header', 'lsx'), |
|
| 50 | 50 | 'section' => 'lsx-layout', |
| 51 | 51 | 'type' => 'checkbox', |
| 52 | 52 | ); |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
| 55 | 55 | 'selector' => '#lsx-header-search-css', |
| 56 | 56 | 'render_callback' => function() { |
| 57 | - $search_form = get_theme_mod( 'lsx_header_search' ); |
|
| 57 | + $search_form = get_theme_mod('lsx_header_search'); |
|
| 58 | 58 | |
| 59 | - if ( false !== $search_form ) { |
|
| 59 | + if (false !== $search_form) { |
|
| 60 | 60 | echo 'body #searchform { display: block; }'; |
| 61 | 61 | } else { |
| 62 | 62 | echo 'body #searchform { display: none; }'; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | $lsx_controls['fields']['lsx_header_layout'] = array( |
| 74 | - 'label' => esc_html__( 'Header', 'lsx' ), |
|
| 74 | + 'label' => esc_html__('Header', 'lsx'), |
|
| 75 | 75 | 'section' => 'lsx-layout', |
| 76 | 76 | 'control' => 'LSX_Customize_Header_Layout_Control', |
| 77 | 77 | 'choices' => array( |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | 90 | $lsx_controls['fields']['lsx_header_mobile_layout'] = array( |
| 91 | - 'label' => esc_html__( 'Mobile Header', 'lsx' ), |
|
| 91 | + 'label' => esc_html__('Mobile Header', 'lsx'), |
|
| 92 | 92 | 'section' => 'lsx-layout', |
| 93 | 93 | 'control' => 'LSX_Customize_Mobile_Header_Layout_Control', |
| 94 | 94 | 'choices' => array( |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | 106 | $lsx_controls['fields']['lsx_layout'] = array( |
| 107 | - 'label' => esc_html__( 'Body', 'lsx' ), |
|
| 107 | + 'label' => esc_html__('Body', 'lsx'), |
|
| 108 | 108 | 'section' => 'lsx-layout', |
| 109 | 109 | 'control' => 'LSX_Customize_Layout_Control', |
| 110 | 110 | 'choices' => array( |
@@ -114,16 +114,16 @@ discard block |
||
| 114 | 114 | ), |
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | - $lsx_controls = apply_filters( 'lsx_layout_customizer_controls', $lsx_controls ); |
|
| 117 | + $lsx_controls = apply_filters('lsx_layout_customizer_controls', $lsx_controls); |
|
| 118 | 118 | |
| 119 | 119 | return $lsx_controls; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | endif; |
| 123 | 123 | |
| 124 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_layout_controls' ); |
|
| 124 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
| 125 | 125 | |
| 126 | -if ( ! function_exists( 'lsx_customizer_template_cover_controls' ) ) : |
|
| 126 | +if ( ! function_exists('lsx_customizer_template_cover_controls')) : |
|
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * Returns an array of the Cover Template panel. |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @return $lsx_controls array() |
| 135 | 135 | */ |
| 136 | - function lsx_customizer_template_cover_controls( $lsx_controls ) { |
|
| 136 | + function lsx_customizer_template_cover_controls($lsx_controls) { |
|
| 137 | 137 | $lsx_controls['sections']['lsx-cover-template'] = array( |
| 138 | - 'title' => esc_html__( 'Cover Template Settings', 'lsx' ), |
|
| 139 | - 'description' => esc_html__( 'Change the cover template settings.', 'lsx' ), |
|
| 138 | + 'title' => esc_html__('Cover Template Settings', 'lsx'), |
|
| 139 | + 'description' => esc_html__('Change the cover template settings.', 'lsx'), |
|
| 140 | 140 | 'priority' => 23, |
| 141 | 141 | ); |
| 142 | 142 | |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | 151 | $lsx_controls['fields']['lsx_cover_template_alt_logo'] = array( |
| 152 | - 'label' => esc_html__( 'Upload Alternative Logo Image', 'lsx' ), |
|
| 153 | - 'description' => __( 'Upload an alternative logo image (svg, png or jpg).', 'lsx' ), |
|
| 152 | + 'label' => esc_html__('Upload Alternative Logo Image', 'lsx'), |
|
| 153 | + 'description' => __('Upload an alternative logo image (svg, png or jpg).', 'lsx'), |
|
| 154 | 154 | 'section' => 'lsx-cover-template', |
| 155 | 155 | 'control' => 'WP_Customize_Media_Control', |
| 156 | 156 | 'mime_type' => 'image', |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | 165 | $lsx_controls['fields']['lsx_cover_template_fixed_background'] = array( |
| 166 | - 'label' => esc_html__( 'Fixed Background Image', 'lsx' ), |
|
| 166 | + 'label' => esc_html__('Fixed Background Image', 'lsx'), |
|
| 167 | 167 | 'section' => 'lsx-cover-template', |
| 168 | 168 | 'type' => 'checkbox', |
| 169 | 169 | ); |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | ); |
| 177 | 177 | |
| 178 | 178 | $lsx_controls['fields']['lsx_cover_template_cover_background_color'] = array( |
| 179 | - 'label' => esc_html__( 'Cover Background Colour', 'lsx' ), |
|
| 180 | - 'description' => __( 'The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx' ), |
|
| 179 | + 'label' => esc_html__('Cover Background Colour', 'lsx'), |
|
| 180 | + 'description' => __('The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx'), |
|
| 181 | 181 | 'section' => 'lsx-cover-template', |
| 182 | 182 | 'control' => 'WP_Customize_Color_Control', |
| 183 | 183 | ); |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | 192 | $lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array( |
| 193 | - 'label' => esc_html__( 'Overlay Background Colour', 'lsx' ), |
|
| 194 | - 'description' => __( 'The colour used for the overlay. Defaults to black.', 'lsx' ), |
|
| 193 | + 'label' => esc_html__('Overlay Background Colour', 'lsx'), |
|
| 194 | + 'description' => __('The colour used for the overlay. Defaults to black.', 'lsx'), |
|
| 195 | 195 | 'section' => 'lsx-cover-template', |
| 196 | 196 | 'control' => 'WP_Customize_Color_Control', |
| 197 | 197 | ); |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = ( |
| 207 | 207 | array( |
| 208 | - 'label' => __( 'Overlay Text Colour', 'lsx' ), |
|
| 209 | - 'description' => __( 'The colour used for the text in the overlay.', 'lsx' ), |
|
| 208 | + 'label' => __('Overlay Text Colour', 'lsx'), |
|
| 209 | + 'description' => __('The colour used for the text in the overlay.', 'lsx'), |
|
| 210 | 210 | 'section' => 'lsx-cover-template', |
| 211 | 211 | 'control' => 'WP_Customize_Color_Control', |
| 212 | 212 | ) |
@@ -221,8 +221,8 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | $lsx_controls['fields']['lsx_cover_template_menu_text_color'] = ( |
| 223 | 223 | array( |
| 224 | - 'label' => __( 'Menu Text Colour', 'lsx' ), |
|
| 225 | - 'description' => __( 'The colour used for the text in the nav menu.', 'lsx' ), |
|
| 224 | + 'label' => __('Menu Text Colour', 'lsx'), |
|
| 225 | + 'description' => __('The colour used for the text in the nav menu.', 'lsx'), |
|
| 226 | 226 | 'section' => 'lsx-cover-template', |
| 227 | 227 | 'control' => 'WP_Customize_Color_Control', |
| 228 | 228 | ) |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | $lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = ( |
| 238 | 238 | array( |
| 239 | - 'label' => __( 'Overlay Opacity', 'lsx' ), |
|
| 240 | - 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ), |
|
| 239 | + 'label' => __('Overlay Opacity', 'lsx'), |
|
| 240 | + 'description' => __('Make sure that the contrast is high enough so that the text is readable.', 'lsx'), |
|
| 241 | 241 | 'section' => 'lsx-cover-template', |
| 242 | 242 | 'type' => 'range', |
| 243 | 243 | ) |
@@ -248,10 +248,10 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | endif; |
| 250 | 250 | |
| 251 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_template_cover_controls' ); |
|
| 251 | +add_filter('lsx_customizer_controls', 'lsx_customizer_template_cover_controls'); |
|
| 252 | 252 | |
| 253 | 253 | |
| 254 | -if ( ! function_exists( 'lsx_get_customizer_controls' ) ) : |
|
| 254 | +if ( ! function_exists('lsx_get_customizer_controls')) : |
|
| 255 | 255 | |
| 256 | 256 | /** |
| 257 | 257 | * Returns an array of $controls for the customizer class to generate. |
@@ -263,10 +263,10 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | function lsx_get_customizer_controls() { |
| 265 | 265 | $lsx_controls = array(); |
| 266 | - $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
| 266 | + $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
|
| 267 | 267 | return $lsx_controls; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | endif; |
| 271 | 271 | |
| 272 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
| 272 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |
|