Changeset 3465036
- Timestamp:
- 02/19/2026 11:34:33 AM (2 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
custom-login-page-logo/tags/1.4/includes/clpl-settings-fields.php
r3465031 r3465036 107 107 function clpl_logo_height_callback() { 108 108 109 $height = clpl_get_option('logo_height' , '100');109 $height = clpl_get_option('logo_height'); 110 110 echo '<input type="number" name="clpl_settings[logo_height]" id="clpl_logo_height" min="0" max="600" 111 111 placeholder="100" title = "Enter logo height" value="' . esc_attr($height) . '" />'; … … 117 117 function clpl_logo_height_unit_callback() { 118 118 119 $height_mmt = esc_attr(clpl_get_option('logo_height_unit' , 'px'));119 $height_mmt = esc_attr(clpl_get_option('logo_height_unit')); 120 120 echo '<select name="clpl_settings[logo_height_unit]" id="clpl_logo_height_unit" title = "Enter logo height measurement unit"> 121 121 <option value="px" ' . selected($height_mmt, 'px', false) . '>Pixels (px)</option> … … 129 129 function clpl_logo_redirect_url_callback() { 130 130 131 $logo_redirect_url = esc_url(clpl_get_option('logo_redirect_url' , ''));131 $logo_redirect_url = esc_url(clpl_get_option('logo_redirect_url')); 132 132 if(empty($logo_redirect_url)){ 133 133 $logo_redirect_url = site_url(); … … 142 142 function clpl_logo_shadow_callback() { 143 143 144 $logo_shadow = esc_attr(clpl_get_option('logo_shadow' , ''));144 $logo_shadow = esc_attr(clpl_get_option('logo_shadow')); 145 145 echo '<input type="checkbox" name="clpl_settings[logo_shadow]" id="clpl_logo_shadow" title="show shadow" 146 146 value="1" ' . checked($logo_shadow, '1', false) . ' />'; … … 152 152 function clpl_logo_border_radius_callback() { 153 153 154 $logo_border_radius = clpl_get_option('logo_border_radius' , '0');154 $logo_border_radius = clpl_get_option('logo_border_radius'); 155 155 echo '<input type="number" name="clpl_settings[logo_border_radius]" id="clpl_logo_border_radius" title="Enter logo border-radius" max = "250" min = "0" placeholder = "5" 156 156 value="' . esc_attr($logo_border_radius) . '" />'; … … 161 161 function clpl_logo_padding_callback() { 162 162 163 $logo_padding = clpl_get_option('logo_padding' , '0');163 $logo_padding = clpl_get_option('logo_padding'); 164 164 echo '<input type="number" name="clpl_settings[logo_padding]" id="clpl_logo_padding" title="Enter logo padding" max = "100" min = "0" placeholder = "5" 165 165 value="' . esc_attr($logo_padding) . '" />'; … … 170 170 function clpl_background_color_callback(){ 171 171 172 $background_color = clpl_get_option('background_color' , 'rgba(255,255,255,1)');172 $background_color = clpl_get_option('background_color'); 173 173 echo '<input type="text" name="clpl_settings[background_color]" id="clpl_background_color" 174 174 title="Select background color" data-alpha-enabled="true" 175 175 value="' . esc_attr($background_color) . '" data-default-color="rgba(255,255,255,1)" />'; 176 176 echo '<p class="description clpl_description">('.esc_html__('Select background color', 'custom-login-page-logo').')</p>'; 177 } 178 179 // ========== DISPLAYS BACKGROUND IMAGE SIZE ========== // 180 function clpl_background_image_size_callback(){ 181 182 $background_image_size = clpl_get_option('background_img_size');?> 183 <select name="clpl_settings[background_img_size]" id="clpl_background_image_size" 184 title="Select background image size" > 185 <option value="cover" <?php selected($background_image_size, 'cover'); ?>> 186 <?php esc_html_e('Cover', 'custom-login-page-logo'); ?> 187 </option> 188 <option value="contain" <?php selected($background_image_size, 'contain'); ?>> 189 <?php esc_html_e('Contain', 'custom-login-page-logo'); ?> 190 </option> 191 <option value="auto" <?php selected($background_image_size, 'auto'); ?>> 192 <?php esc_html_e('Auto', 'custom-login-page-logo'); ?> 193 </option> 194 </select> 195 <p class="description clpl_description"> 196 (<?php esc_html_e('Select background image size', 'custom-login-page-logo');?>)</p> 197 <?php 177 198 } 178 199 … … 340 361 $input = wp_parse_args($input, $existing); 341 362 363 $allowed_units = array('px', '%'); 364 $allowed_bg_img_size = array('cover', 'contain', 'auto'); 365 342 366 $sanitized = array(); 343 367 … … 345 369 $sanitized['logo_field'] = esc_url_raw($input['logo_field']); 346 370 $sanitized['logo_width'] = intval($input['logo_width']); 347 $sanitized['logo_width_unit'] = in_array($input['logo_width_unit'], ['px','%'], true) ? $input['logo_width_unit'] : 'px'; 371 $sanitized['logo_width_unit'] = in_array( 372 $input['logo_width_unit'], 373 $allowed_units, 374 true 375 ) 376 ? $input['logo_width_unit'] : $defaults['logo_width_unit']; 348 377 $sanitized['logo_height'] = intval($input['logo_height']); 349 $sanitized['logo_height_unit'] = in_array($input['logo_height_unit'], ['px','%'], true) ? $input['logo_height_unit'] : 'px'; 378 $sanitized['logo_height_unit'] = in_array( 379 $input['logo_height_unit'], 380 $allowed_units, 381 true 382 ) 383 ? $input['logo_height_unit'] : $defaults['logo_height_unit']; 350 384 $sanitized['logo_redirect_url'] = esc_url_raw($input['logo_redirect_url']); 351 385 $sanitized['logo_shadow'] = sanitize_text_field($input['logo_shadow']); … … 355 389 // Background 356 390 $sanitized['background_color'] = sanitize_hex_color($input['background_color']) ?: '#FFFFFF'; 391 $sanitized['background_img'] = esc_url_raw($input['background_img']); 357 392 358 393 // Review system
Note: See TracChangeset
for help on using the changeset viewer.