| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * Settings class for browser language preference detection |
| 8 | 5 | * |
| @@ -8,14 +5,8 @@ | ||
| 8 | 5 | * |
| 9 | 6 | * @since 1.8 |
| 10 | 7 | */ |
| 11 | 8 | class PLL_Settings_Browser extends PLL_Settings_Module { |
| 12 | - /** | |
| 13 | - * Stores the display order priority. | |
| 14 | - * | |
| 15 | - * @var int | |
| 16 | - */ | |
| 17 | - public $priority = 20; | |
| 18 | 9 | |
| 19 | 10 | /** |
| 20 | 11 | * Constructor |
| 21 | 12 | * |
| @@ -66,10 +57,8 @@ | ||
| 66 | 57 | * Displays the javascript to handle dynamically the change in url modifications |
| 67 | 58 | * as the preferred browser language is not used when the language is set from different domains |
| 68 | 59 | * |
| 69 | 60 | * @since 1.8 |
| 70 | - * | |
| 71 | - * @return void | |
| 72 | 61 | */ |
| 73 | 62 | public function print_js() { |
| 74 | 63 | wp_enqueue_script( 'jquery' ); |
| 75 | 64 | |
| @@ -86,21 +75,19 @@ | ||
| 86 | 75 | |
| 87 | 76 | ?> |
| 88 | 77 | <script type='text/javascript'> |
| 89 | 78 | //<![CDATA[ |
| 90 | - jQuery( | |
| 91 | - function( $ ){ | |
| 92 | - $( "input[name='force_lang']" ).on( 'change', function() { | |
| 93 | - var value = $( this ).val(); | |
| 94 | - if ( 3 > value ) { | |
| 95 | - $( "#pll-module-browser" ).<?php echo $func; // phpcs:ignore WordPress.Security.EscapeOutput ?>.children( "td" ).children( ".row-actions" ).html( '<?php echo $link; // phpcs:ignore WordPress.Security.EscapeOutput ?>' ); | |
| 96 | - } | |
| 97 | - else { | |
| 98 | - $( "#pll-module-browser" ).removeClass( "active" ).addClass( "inactive" ).children( "td" ).children( ".row-actions" ).html( '<?php echo $deactivated; // phpcs:ignore WordPress.Security.EscapeOutput ?>' ); | |
| 99 | - } | |
| 100 | - } ); | |
| 101 | - } | |
| 102 | - ); | |
| 79 | + ( function( $ ){ | |
| 80 | + $( "input[name='force_lang']" ).change( function() { | |
| 81 | + var value = $( this ).val(); | |
| 82 | + if ( 3 > value ) { | |
| 83 | + $( "#pll-module-browser" ).<?php echo $func; // phpcs:ignore WordPress.Security.EscapeOutput ?>.children( "td" ).children( ".row-actions" ).html( '<?php echo $link; // phpcs:ignore WordPress.Security.EscapeOutput ?>' ); | |
| 84 | + } | |
| 85 | + else { | |
| 86 | + $( "#pll-module-browser" ).removeClass( "active" ).addClass( "inactive" ).children( "td" ).children( ".row-actions" ).html( '<?php echo $deactivated; // phpcs:ignore WordPress.Security.EscapeOutput ?>' ); | |
| 87 | + } | |
| 88 | + } ); | |
| 89 | + } )( jQuery ); | |
| 103 | 90 | // ]]> |
| 104 | 91 | </script> |
| 105 | 92 | <?php |
| 106 | 93 | } |