Plugin Directory

Changeset 3465036


Ignore:
Timestamp:
02/19/2026 11:34:33 AM (2 days ago)
Author:
horendra
Message:

Second parameter of the function clpl_get_option() is deleted as no require now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • custom-login-page-logo/tags/1.4/includes/clpl-settings-fields.php

    r3465031 r3465036  
    107107    function clpl_logo_height_callback() {
    108108
    109         $height = clpl_get_option('logo_height', '100');
     109        $height = clpl_get_option('logo_height');
    110110        echo '<input type="number" name="clpl_settings[logo_height]" id="clpl_logo_height" min="0" max="600"
    111111              placeholder="100" title = "Enter logo height" value="' . esc_attr($height) . '" />';
     
    117117    function clpl_logo_height_unit_callback() {
    118118
    119         $height_mmt = esc_attr(clpl_get_option('logo_height_unit', 'px'));
     119        $height_mmt = esc_attr(clpl_get_option('logo_height_unit'));
    120120        echo '<select name="clpl_settings[logo_height_unit]" id="clpl_logo_height_unit" title = "Enter logo height measurement unit">
    121121                <option value="px" ' . selected($height_mmt, 'px', false) . '>Pixels (px)</option>
     
    129129    function clpl_logo_redirect_url_callback() {
    130130
    131         $logo_redirect_url = esc_url(clpl_get_option('logo_redirect_url', ''));
     131        $logo_redirect_url = esc_url(clpl_get_option('logo_redirect_url'));
    132132        if(empty($logo_redirect_url)){
    133133            $logo_redirect_url = site_url();
     
    142142    function clpl_logo_shadow_callback() {
    143143
    144         $logo_shadow = esc_attr(clpl_get_option('logo_shadow', ''));
     144        $logo_shadow = esc_attr(clpl_get_option('logo_shadow'));
    145145        echo '<input type="checkbox" name="clpl_settings[logo_shadow]" id="clpl_logo_shadow" title="show shadow"
    146146              value="1" ' . checked($logo_shadow, '1', false) . ' />';
     
    152152    function clpl_logo_border_radius_callback() {
    153153
    154         $logo_border_radius = clpl_get_option('logo_border_radius', '0');
     154        $logo_border_radius = clpl_get_option('logo_border_radius');
    155155        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"
    156156              value="' . esc_attr($logo_border_radius) . '" />';
     
    161161    function clpl_logo_padding_callback() {
    162162
    163         $logo_padding = clpl_get_option('logo_padding', '0');
     163        $logo_padding = clpl_get_option('logo_padding');
    164164        echo '<input type="number" name="clpl_settings[logo_padding]" id="clpl_logo_padding" title="Enter logo padding" max = "100" min = "0" placeholder = "5"
    165165              value="' . esc_attr($logo_padding) . '" />';
     
    170170    function clpl_background_color_callback(){
    171171
    172         $background_color = clpl_get_option('background_color', 'rgba(255,255,255,1)');
     172        $background_color = clpl_get_option('background_color');
    173173        echo '<input type="text" name="clpl_settings[background_color]" id="clpl_background_color"
    174174        title="Select background color" data-alpha-enabled="true"
    175175        value="' . esc_attr($background_color) . '" data-default-color="rgba(255,255,255,1)" />';
    176176        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
    177198    }
    178199   
     
    340361            $input = wp_parse_args($input, $existing);
    341362
     363            $allowed_units          = array('px', '%');
     364            $allowed_bg_img_size    = array('cover', 'contain', 'auto');
     365
    342366            $sanitized = array();
    343367
     
    345369            $sanitized['logo_field']          = esc_url_raw($input['logo_field']);
    346370            $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'];
    348377            $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'];
    350384            $sanitized['logo_redirect_url']   = esc_url_raw($input['logo_redirect_url']);
    351385            $sanitized['logo_shadow']         = sanitize_text_field($input['logo_shadow']);
     
    355389            // Background
    356390            $sanitized['background_color']    = sanitize_hex_color($input['background_color']) ?: '#FFFFFF';
     391            $sanitized['background_img']    = esc_url_raw($input['background_img']);
    357392
    358393            // Review system
Note: See TracChangeset for help on using the changeset viewer.