Plugin Directory

Changeset 3465075


Ignore:
Timestamp:
02/19/2026 12:16:28 PM (2 days ago)
Author:
horendra
Message:

background image callback function is added

File:
1 edited

Legend:

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

    r3465073 r3465075  
    176176        echo '<p class="description clpl_description">('.esc_html__('Select background color', 'custom-login-page-logo').')</p>';
    177177    }
     178
     179    // ========== DISPLAYS BACKGROUND IMAGE ========== //
     180    function clpl_background_image_callback(){
     181
     182        $background_image = clpl_get_option('background_img');
     183        echo '<input type="url" name="clpl_settings[background_img]" id="clpl_background_image"
     184         autocomplete="on"
     185         placeholder="Enter background image URL" title="'.esc_attr($background_image).'"
     186         value="' . esc_url($background_image) . '"  />';
     187        echo '<button class="button button-secondary" id="upload_bg_img">' . esc_html__('Upload background image', 'custom-login-page-logo') . '</button>';
     188        echo '<p class="description clpl_description">('.esc_html__('(Upload image or enter a custom URL with http or https)', 'custom-login-page-logo').')</p>';
     189       
     190        if (!empty($background_image)) {
     191            echo '<div id="clpl_bg_img_container">
     192                    <img src="' . esc_url($background_image) . '"
     193                    title="' . esc_attr(basename($background_image)) . '" alt = "Background image" />
     194                  </div>';
     195        }
     196    }
    178197   
    179198    // DEFAULT VALUES OF THE OPTIONS OF THE PLUGIN
Note: See TracChangeset for help on using the changeset viewer.