Plugin Directory

Changeset 1965355


Ignore:
Timestamp:
10/29/2018 07:38:59 PM (7 years ago)
Author:
colorlibplugins
Message:

Update to 1.2.2

Location:
colorlib-login-customizer
Files:
120 added
6 edited

Legend:

Unmodified
Added
Removed
  • colorlib-login-customizer/trunk/assets/js/clc-customizer.js

    r1888161 r1965355  
    127127                var control = this,
    128128                    updating = false;
    129                
     129
    130130                control.values = control.params.value;
    131131
     
    136136                    control.updateColumns( currentAction );
    137137                    updating = false;
    138                    
     138
    139139                });
    140140
     
    273273                    }
    274274                });
    275             });
     275            });
     276
     277            // validation for the login-level setting
     278            wp.customize( 'clc-options[login-label]', function ( setting ) {
     279                setting.validate = function ( value ) {
     280                    var code, notification;
     281
     282                    code = 'required';
     283                    if ( ! value ) {
     284                        notification = new wp.customize.Notification( code, {message: 'value is empty' } );
     285                        setting.notifications.add( code, notification );
     286                    } else {
     287                        setting.notifications.remove( code );
     288                    }
     289
     290                    return value;
     291                };
     292            } );
    276293
    277294            wp.customize( 'clc-options[use-text-logo]', function( value ) {
  • colorlib-login-customizer/trunk/assets/js/clc-preview.js

    r1888161 r1965355  
    142142  } );
    143143
     144  // Remember Me label
     145  wp.customize( 'clc-options[rememberme-label]', function( value ) {
     146    value.bind( function( to ) {
     147      $( '#clc-rememberme-label' ).text( to );
     148    } );
     149  } );
     150
     151  // Login label
     152  wp.customize( 'clc-options[login-label]', function( value ) {
     153    value.bind( function( to ) {
     154      if( ! to ) {
     155        return;
     156      }
     157      $( '#wp-submit' ).val( to );
     158    } );
     159  } );
     160
    144161  // Columns width
    145162  wp.customize( 'clc-options[columns-width]', function( value ) {
  • colorlib-login-customizer/trunk/includes/lib/class-colorlib-login-customizer-css-customization.php

    r1888161 r1965355  
    3838        add_filter( 'login_headertitle', array( $this, 'logo_text' ), 99 );
    3939
    40         // 
     40        //
    4141        add_action( 'customize_preview_init', array( $this, 'output_css_object' ), 26 );
    4242    }
     
    128128            'username-label'            => 'Username or Email Address',
    129129            'password-label'            => 'Password',
     130            'rememberme-label'          => 'Remember Me',
     131            'login-label'               => 'Log In',
    130132            'form-label-color'          => '',
    131133            'hide-extra-links'          => false,
     
    759761        add_filter( 'gettext', array( $this, 'change_username_label' ), 99, 3 );
    760762        add_filter( 'gettext', array( $this, 'change_password_label' ), 99, 3 );
     763        add_filter( 'gettext', array( $this, 'change_rememberme_label' ), 99, 3 );
     764        add_filter( 'gettext', array( $this, 'change_login_label' ), 99, 3 );
    761765
    762766    }
     
    815819    }
    816820
     821    /**
     822     * Customizer output for custom remember me text.
     823     *
     824     * @param string|string $translated_text The translated text.
     825     * @param string|string $text The label we want to replace.
     826     * @param string|string $domain The text domain of the site.
     827     * @return string
     828     */
     829    public function change_rememberme_label( $translated_text, $text, $domain ) {
     830        $default = 'Remember Me';
     831        $label   = $this->options['rememberme-label'];
     832
     833        // Check if is our text
     834        if ( $default !== $text ) {
     835            return $translated_text;
     836        }
     837
     838        // Check if the label is changed
     839        if ( $label === $text ) {
     840            return $translated_text;
     841        } else {
     842            $translated_text = esc_html( $label );
     843        }
     844
     845        return $translated_text;
     846    }
     847
     848    /**
     849     * Customizer output for custom login text.
     850     *
     851     * @param string|string $translated_text The translated text.
     852     * @param string|string $text The label we want to replace.
     853     * @param string|string $domain The text domain of the site.
     854     * @return string
     855     */
     856    public function change_login_label( $translated_text, $text, $domain ) {
     857        $default = 'Log In';
     858        $label   = $this->options['login-label'];
     859
     860        // Check if is our text
     861        if ( $default !== $text ) {
     862            return $translated_text;
     863        }
     864
     865        // Check if the label is changed
     866        if ( $label === $text ) {
     867            return $translated_text;
     868        } else {
     869            $translated_text = esc_attr( $label );
     870        }
     871
     872        return $translated_text;
     873    }
     874
    817875}
  • colorlib-login-customizer/trunk/includes/lib/class-colorlib-login-customizer-customizer.php

    r1888161 r1965355  
    619619                ),
    620620                array(
     621                    'id'          => 'rememberme-label',
     622                    'label'       => esc_html__( 'Remember Me label', 'colorlib-login-customizer' ),
     623                    'description' => esc_html__( 'You can change the default remember me text.', 'colorlib-login-customizer' ),
     624                    'type'        => 'text',
     625                    'default'     => 'Remember Me',
     626                ),
     627                array(
     628                    'id'          => 'login-label',
     629                    'label'       => esc_html__( 'Login label', 'colorlib-login-customizer' ),
     630                    'description' => esc_html__( 'You can change the default text for the log in button.', 'colorlib-login-customizer' ),
     631                    'type'        => 'text',
     632                    'default'     => 'Log In',
     633                ),
     634                array(
    621635                    'id'          => 'hide-extra-links',
    622636                    'label'       => esc_html__( 'Hide Extra Links', 'colorlib-login-customizer' ),
  • colorlib-login-customizer/trunk/includes/login-template.php

    r1888161 r1965355  
    182182                do_action( 'login_form' );
    183183                ?>
    184                 <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></label></p>
     184                <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span id="clc-rememberme-label"><?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></span></label></p>
    185185                <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'colorlib-login-customizer' ); ?>" /></p>
    186186            </form>
  • colorlib-login-customizer/trunk/readme.txt

    r1961430 r1965355  
    44Requires at least: 4.7
    55Tested up to: 4.9
    6 Stable tag: trunk
     6Stable tag: 1.2.2
    77License: GPLv2 or later
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     8License URI: http://www.gnu.org/licenses/gpl-3.0.html
    99
    1010Colorlib Login Customizer by Colorlib is a plugin that helps you personalize your login form directly from the Customizer.
     
    105105== Changelog ==
    106106
     107= 1.2.2 =
     108* Added the possibility to change the `Remember Me` and `Log In` texts
     109
    107110= 1.2.1 =
    108 * Minor fixes.
     111* Minor tweaks & version bump
    109112
    110113= 1.2.0 =
Note: See TracChangeset for help on using the changeset viewer.