| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * The language switcher widget |
| 8 | 5 | * |
| @@ -66,9 +63,9 @@ | ||
| 66 | 63 | * @param array $old_instance Old settings for this instance |
| 67 | 64 | * @return array Settings to save or bool false to cancel saving |
| 68 | 65 | */ |
| 69 | 66 | public function update( $new_instance, $old_instance ) { |
| 70 | - $instance = array( 'title' => sanitize_text_field( $new_instance['title'] ) ); | |
| 67 | + $instance['title'] = sanitize_text_field( $new_instance['title'] ); | |
| 71 | 68 | foreach ( array_keys( PLL_Switcher::get_switcher_options( 'widget' ) ) as $key ) { |
| 72 | 69 | $instance[ $key ] = ! empty( $new_instance[ $key ] ) ? 1 : 0; |
| 73 | 70 | } |
| 74 | 71 | |
| @@ -137,9 +134,9 @@ | ||
| 137 | 134 | |
| 138 | 135 | // Remove all options if dropdown is checked |
| 139 | 136 | $( '.widgets-sortables,.control-section-sidebar' ).on( 'change', '.pll-dropdown', function() { |
| 140 | 137 | var this_id = $( this ).parent().parent().parent().children( '.widget-id' ).attr( 'value' ); |
| 141 | - pll_toggle( $( '.no-dropdown-' + this_id ), true != $( this ).prop( 'checked' ) ); | |
| 138 | + pll_toggle( $( '.no-dropdown-' + this_id ), 'checked' != $( this ).attr( 'checked' ) ); | |
| 142 | 139 | } ); |
| 143 | 140 | |
| 144 | 141 | // Disallow unchecking both show names and show flags |
| 145 | 142 | var options = ['-show_flags', '-show_names']; |
| @@ -145,9 +142,9 @@ | ||
| 145 | 142 | var options = ['-show_flags', '-show_names']; |
| 146 | 143 | $.each( options, function( i, v ) { |
| 147 | 144 | $( '.widgets-sortables,.control-section-sidebar' ).on( 'change', '.pll' + v, function() { |
| 148 | 145 | var this_id = $( this ).parent().parent().parent().children( '.widget-id' ).attr( 'value' ); |
| 149 | - if ( true != $( this ).prop( 'checked' ) ) { | |
| 146 | + if ( 'checked' != $( this ).attr( 'checked' ) ) { | |
| 150 | 147 | $( '#widget-' + this_id + options[ 1-i ] ).prop( 'checked', true ); |
| 151 | 148 | } |
| 152 | 149 | } ); |
| 153 | 150 | } ); |