Plugin Directory

Changeset 2782839


Ignore:
Timestamp:
09/10/2022 06:03:45 PM (4 years ago)
Author:
apsaraaruna
Message:

Screenshot added
Added dynamic wallpaper select option.

Location:
simple-login-customize
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • simple-login-customize/trunk/README.txt

    r2782673 r2782839  
    3535== Screenshots ==
    3636
    37 1. Sample screen (dynamic wallpaper will get you)
    38 2. Sample screen (dynamic wallpaper will get you)
    39 3. Sample screen (dynamic wallpaper will get you)
     371. Dynamic wallper paper loading with your choice
     382. Dynamic wallper paper loading with your choice
     393. Dynamic wallper paper loading with your choice
    40404. Plugin settings
    41 5. Logo add in customizer
     415. Logo change from customizer
    4242
    4343== Changelog ==
  • simple-login-customize/trunk/admin/class-simple-login-customize-admin-settings.php

    r2782673 r2782839  
    5858        add_options_page(
    5959            'Simple Login Customize Options',// The title to be displayed in the browser window for this page.
    60             'Simple Login Customize Options',// The text to be displayed for this menu item
     60            'Simple Login Customize',// The text to be displayed for this menu item
    6161            'manage_options',// Which type of users can see this menu item
    6262            'slc_options',// The unique ID - that is, the slug - for this menu item
     
    7474
    7575        $defaults = array(
    76             'login_username'    =>  '',
    77             'hide_lostpassword' =>  '',
    78             'back_to_blog'      =>  '',
    79             'login_logo'        =>  '',
    80             'custom_err_msg '       =>  '',
     76            'login_username'    =>  0,
     77            'hide_lostpassword' =>  0,
     78            'back_to_blog'      =>  0,
     79            'login_logo'        =>  0,
     80            'custom_err_msg '   =>  0,
    8181            'custom_err_msg_txt'=>  'Please enter valid login credentials.',
     82            'background_category' => 'sport'
    8283        );
    8384
     
    253254        );
    254255
     256        add_settings_field(
     257            'background_image_category',
     258            __( 'Background category', 'simple-login-customize' ),
     259            array( $this, 'toggle_background_image_callback'),
     260            'slc_display_options',
     261            'general_settings_section',
     262            array(
     263                __( 'Activate this setting to customize login error message.', 'simple-login-customize' ),
     264            )
     265        );
    255266        // Finally, we register the fields with WordPress
    256267        register_setting(
     
    397408    } // end toggle_login_logo_callback
    398409
     410    public function toggle_background_image_callback(){
     411        $options = get_option('slc_display_options');
     412
     413        if ( empty($options['background_category']) ) {
     414            $default_array = $this->Default_Display_options();
     415            $options['background_category'] = $default_array['background_category'];
     416        }
     417
     418        $html = '<select id="background_category" name="slc_display_options[background_category]">';
     419        $html .= '<option value="nature" selected>' . __( 'Nature', 'simple-login-customize' ) . '</option>';
     420        $html .= '<option value="sport"' . selected( $options['background_category'], 'sport', false) . '>' . __( 'Sport', 'simple-login-customize' ) . '</option>';
     421        $html .= '<option value="landscape"' . selected( $options['background_category'], 'landscape', false) . '>' . __( 'Landscape', 'simple-login-customize' ) . '</option>';
     422        $html .= '<option value="background"' . selected( $options['background_category'], 'background', false) . '>' . __( 'Background', 'simple-login-customize' ) . '</option>';
     423        $html .= '<option value="wallpaper"' . selected( $options['background_category'], 'wallpaper', false) . '>' . __( 'Wallpaper', 'simple-login-customize' ) . '</option>';
     424        $html .= '<option value="flower"' . selected( $options['background_category'], 'flower', false) . '>' . __( 'Flower', 'simple-login-customize' ) . '</option>';
     425        $html .= '<option value="fashion"' . selected( $options['background_category'], 'fashion', false) . '>' . __( 'Fashion', 'simple-login-customize' ) . '</option>';
     426        $html .= '<option value="health"' . selected( $options['background_category'], 'health', false) . '>' . __( 'Health', 'simple-login-customize' ) . '</option>';
     427        $html .= '<option value="travel"' . selected( $options['background_category'], 'travel', false) . '>' . __( 'Travel', 'simple-login-customize' ) . '</option>';
     428        $html .= '<option value="animal"' . selected( $options['background_category'], 'animal', false) . '>' . __( 'Animal', 'simple-login-customize' ) . '</option>';
     429        $html .= '<option value="arts"' . selected( $options['background_category'], 'arts', false) . '>' . __( 'Arts', 'simple-login-customize' ) . '</option>';
     430        $html .= '<option value="water"' . selected( $options['background_category'], 'water', false) . '>' . __( 'Water', 'simple-login-customize' ) . '</option>';    $html .= '</select>';
     431
     432        $allowed_html = array(
     433            'select' => array(
     434                'id'    => array(),
     435                'name'  => array(),
     436                'value' => array(),
     437                'checked'  => array()
     438            ),
     439            'option' =>array(
     440                'value' => array(),
     441                'disabled' => array(),
     442                'selected' => array()
     443            )
     444        );
     445
     446        echo wp_kses($html ,$allowed_html );
     447    }
     448
    399449
    400450    public function validate_input_examples( $input ) {
  • simple-login-customize/trunk/includes/class-simple-login-customize.php

    r2782673 r2782839  
    201201        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
    202202        $this->loader->add_action( 'login_enqueue_scripts', $plugin_public, 'slc_login_style' );
     203        $this->loader->add_action( 'login_enqueue_scripts', $plugin_public, 'Slc_background_image' );
    203204       
    204205        $this->loader->add_filter( 'login_headerurl', $plugin_public, 'Slc_Login_Logo_url' );
  • simple-login-customize/trunk/public/class-simple-login-customize-public.php

    r2782673 r2782839  
    7575
    7676        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/simple-login-customize-public.css', array(), $this->version, 'all' );
    77 
    78        
    79 
    8077    }
    8178
     
    137134        }
    138135
     136        function Slc_background_image(){
     137            $options = get_option('slc_display_options');
     138            ?>
     139            <style>body.login { background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url( "https://source.unsplash.com/random/1600/?<?php echo $options['background_category']; ?>" ) !important; background-repeat: no-repeat !important; background-attachment: fixed !important; background-position: center !important; background-size: cover !important;</style>
     140        <?php }
     141
    139142        function Slc_Custom_Login_head() {
    140143            remove_action('login_footer', 'wp_shake_js', 12);
  • simple-login-customize/trunk/public/css/custom-login-style.css

    r2782673 r2782839  
    1 #login h1 a,.login h1 a{height:100px;width:300px;background-size:300px 100px;background-repeat:no-repeat;padding-bottom:0px;margin-bottom:0}body.login{background:linear-gradient(rgba(0,0,0,0.45),rgba(0,0,0,0.45)),url( "https://source.unsplash.com/random/1920x1080/?wallpaper,landscape" )!important;background-repeat:no-repeat;background-attachment:fixed;background-position:center}.login form{box-shadow:none;padding:20px;border:0px solid #c3c4c7}#login{background:#FFF;margin:0px auto;padding:40px 20px;width:350px;border-radius:7px;display:block;position:relative;top:10%}.login label{color:#555;font-size:14px}.login form .forgetmenot{float:none}#login form p.submit{margin-top:15px}.login.wp-core-ui .button-primary{background:#4b4646;border-color:#4b4646;box-shadow:0 1px 0 #4b4646;color:#FFF;text-shadow:none;float:none;clear:both;display:block;width:100%;padding:7px;height:auto;font-size:15px;border-radius:7px}.copyrights{text-align:center;position:absolute;bottom:12px;color:#fff;left:0;right:0;font-size:70%;width:200px;margin-left:auto;margin-right:auto}.company-logo{display:block;position:absolute;bottom:30px;left:0;right:0;margin:0 auto}@media  screen and (max-width:1440px){#login{padding:20px 20px}.login #nav{margin:5px 0 0 0}.login .privacy-policy-page-link{text-align:center;width:100%;margin:0em 0 3em}#backtoblog{margin:10px 0}}@media  screen and (max-width:1280px){.login form{margin-top:0px}#login h1 a,.login h1 a{height:70px;width:210px;background-size:210px 70px}.login .privacy-policy-page-link{margin:0em 0 0em}.login.wp-core-ui .button-primary{padding:5px;font-size:14px}}@media (max-width:480px){body.login{background:#fff!important}.copyrights{color:#333!important;position:relative!important;bottom:-30px!important}.company-logo{position:relative;bottom:-20px;width:70px}}
     1#login h1 a, .login h1 a { height: 100px; width: 300px; background-size: 300px 100px; background-repeat: no-repeat; padding-bottom: 0px; margin-bottom: 0 }
     2body.login {
     3    /*background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url( "https://source.unsplash.com/random/1920x1080/?wallpaper,landscape" ) !important;*/
     4    background-repeat: no-repeat !important;
     5    background-attachment: fixed!important;
     6    background-position: center !important;
     7    background-size: cover !important;
     8}
     9
     10.login form {
     11    box-shadow: none;
     12    padding: 20px;
     13    border: 0px solid #c3c4c7
     14}
     15
     16#login {
     17    background: #FFF;
     18    margin: 0px auto;
     19    padding: 40px 20px;
     20    width: 350px;
     21    border-radius: 7px;
     22    display: block;
     23    position: relative;
     24    top: 10%
     25}
     26.login label { color: #555; font-size: 14px }
     27.login form .forgetmenot { float: none }
     28#login form p.submit { margin-top: 15px }
     29.login.wp-core-ui .button-primary { background: #4b4646; border-color: #4b4646; box-shadow: 0 1px 0 #4b4646; color: #FFF; text-shadow: none; float: none; clear: both; display: block; width: 100%; padding: 7px; height: auto; font-size: 15px; border-radius: 7px }
     30.copyrights { text-align: center; position: absolute; bottom: 12px; color: #fff; left: 0; right: 0; font-size: 70%; width: 200px; margin-left: auto; margin-right: auto }
     31.company-logo { display: block; position: absolute; bottom: 30px; left: 0; right: 0; margin: 0 auto }
     32@media  screen and (max-width:1440px) {
     33    #login { padding: 20px 20px }
     34    .login #nav { margin: 5px 0 0 0 }
     35    .login .privacy-policy-page-link { text-align: center; width: 100%; margin: 0em 0 3em }
     36    #backtoblog { margin: 10px 0 }
     37}
     38@media  screen and (max-width:1280px) {
     39    .login form { margin-top: 0px }
     40    #login h1 a, .login h1 a { height: 70px; width: 210px; background-size: 210px 70px }
     41    .login .privacy-policy-page-link { margin: 0em 0 0em }
     42    .login.wp-core-ui .button-primary { padding: 5px; font-size: 14px }
     43}
     44@media (max-width:480px) {
     45    body.login { background: #fff !important }
     46    .copyrights { color: #333 !important; position: relative !important; bottom: -30px !important }
     47    .company-logo { position: relative; bottom: -20px; width: 70px }
     48}
Note: See TracChangeset for help on using the changeset viewer.