PluginProbe
Polylang / 3.7.1
Polylang v3.7.1
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 +5 -5 3.03.7.1 View file →
@@ -23,16 +23,18 @@
23 23 *
24 24 * @param object $polylang polylang object
25 25 */
26 26 public function __construct( &$polylang ) {
27 + // Needed for `$this->is_available()`, which is used before calling the parent's constructor.
27 28 $this->options = &$polylang->options;
29 +
28 30 parent::__construct(
29 31 $polylang,
30 32 array(
31 33 'module' => 'browser',
32 34 'title' => __( 'Detect browser language', 'polylang' ),
33 - 'description' => __( 'When the front page is visited, set the language according to the browser preference', 'polylang' ),
34 - 'active_option' => $this->is_available() ? 'browser' : false,
35 + 'description' => __( 'When the front page is visited, redirects to itself in the browser preferred language. As this doesn\'t work if it is cached, Polylang will attempt to disable the front page cache for known cache plugins.', 'polylang' ),
36 + 'active_option' => $this->is_available() ? 'browser' : 'none',
35 37 )
36 38 );
37 39
38 40 if ( ! class_exists( 'PLL_Xdata_Domain', true ) ) {
@@ -84,10 +86,9 @@
84 86
85 87 $deactivated = sprintf( '<span class="deactivated">%s</span>', $this->action_links['deactivated'] );
86 88
87 89 ?>
88 - <script type='text/javascript'>
89 - //<![CDATA[
90 + <script>
90 91 jQuery(
91 92 function( $ ){
92 93 $( "input[name='force_lang']" ).on( 'change', function() {
93 94 var value = $( this ).val();
@@ -99,9 +100,8 @@
99 100 }
100 101 } );
101 102 }
102 103 );
103 - // ]]>
104 104 </script>
105 105 <?php
106 106 }
107 107 }