PluginProbe
Polylang / 2.5
Polylang v2.5
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | settings/settings-browser.php +11 -25 3.0.22.5 View file →
@@ -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 *
@@ -23,9 +14,8 @@
23 14 *
24 15 * @param object $polylang polylang object
25 16 */
26 17 public function __construct( &$polylang ) {
27 - $this->options = &$polylang->options;
28 18 parent::__construct(
29 19 $polylang,
30 20 array(
31 21 'module' => 'browser',
@@ -66,10 +56,8 @@
66 56 * Displays the javascript to handle dynamically the change in url modifications
67 57 * as the preferred browser language is not used when the language is set from different domains
68 58 *
69 59 * @since 1.8
70 - *
71 - * @return void
72 60 */
73 61 public function print_js() {
74 62 wp_enqueue_script( 'jquery' );
75 63
@@ -86,21 +74,19 @@
86 74
87 75 ?>
88 76 <script type='text/javascript'>
89 77 //<![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 - );
78 + ( function( $ ){
79 + $( "input[name='force_lang']" ).change( function() {
80 + var value = $( this ).val();
81 + if ( 3 > value ) {
82 + $( "#pll-module-browser" ).<?php echo $func; ?>.children( "td" ).children( ".row-actions" ).html( '<?php echo $link; ?>' );
83 + }
84 + else {
85 + $( "#pll-module-browser" ).removeClass( "active" ).addClass( "inactive" ).children( "td" ).children( ".row-actions" ).html( '<?php echo $deactivated; ?>' );
86 + }
87 + } );
88 + } )( jQuery );
103 89 // ]]>
104 90 </script>
105 91 <?php
106 92 }