PluginProbe
Polylang / 3.3
Polylang v3.3
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-url.php +22 -3 2.83.3 View file →
@@ -16,8 +16,15 @@
16 16 */
17 17 public $priority = 10;
18 18
19 19 /**
20 + * The page id of the static front page.
21 + *
22 + * @var int|null
23 + */
24 + protected $page_on_front;
25 +
26 + /**
20 27 * Constructor
21 28 *
22 29 * @since 1.8
23 30 *
@@ -29,13 +36,11 @@
29 36 array(
30 37 'module' => 'url',
31 38 'title' => __( 'URL modifications', 'polylang' ),
32 39 'description' => __( 'Decide how your URLs will look like.', 'polylang' ),
33 - 'configure' => true,
34 40 )
35 41 );
36 42
37 - $this->links_model = &$polylang->links_model;
38 43 $this->page_on_front = &$polylang->static_pages->page_on_front;
39 44 }
40 45
41 46 /**
@@ -41,11 +46,14 @@
41 46 /**
42 47 * Displays the fieldset to choose how the language is set
43 48 *
44 49 * @since 1.8
50 + *
51 + * @return void
45 52 */
46 53 protected function force_lang() {
47 54 ?>
55 + <p class="description"><?php esc_html_e( 'Some themes or plugins may not be fully compatible with the language defined by the content or by domains.', 'polylang' ); ?></p>
48 56 <label>
49 57 <?php
50 58 printf(
51 59 '<input name="force_lang" type="radio" value="0" %s /> %s',
@@ -106,8 +114,10 @@
106 114 /**
107 115 * Displays the fieldset to choose to hide the default language information in url
108 116 *
109 117 * @since 1.8
118 + *
119 + * @return void
110 120 */
111 121 protected function hide_default() {
112 122 ?>
113 123 <label>
@@ -125,8 +135,10 @@
125 135 /**
126 136 * Displays the fieldset to choose to hide /language/ in url
127 137 *
128 138 * @since 1.8
139 + *
140 + * @return void
129 141 */
130 142 protected function rewrite() {
131 143 ?>
132 144 <label>
@@ -157,8 +169,10 @@
157 169 /**
158 170 * Displays the fieldset to choose to redirect the home page to language page
159 171 *
160 172 * @since 1.8
173 + *
174 + * @return void
161 175 */
162 176 protected function redirect_lang() {
163 177 ?>
164 178 <label>
@@ -165,9 +179,9 @@
165 179 <?php
166 180 printf(
167 181 '<input name="redirect_lang" type="checkbox" value="1" %s/> %s',
168 182 checked( $this->options['redirect_lang'], 1, false ),
169 - esc_html__( 'The front page url contains the language code instead of the page name or page id', 'polylang' )
183 + esc_html__( 'The front page URL contains the language code instead of the page name or page id', 'polylang' )
170 184 );
171 185 ?>
172 186 </label>
173 187 <p class="description">
@@ -189,8 +203,10 @@
189 203 /**
190 204 * Displays the settings
191 205 *
192 206 * @since 1.8
207 + *
208 + * @return void
193 209 */
194 210 public function form() {
195 211 ?>
196 212 <div class="pll-settings-url-col">
@@ -229,8 +245,9 @@
229 245 *
230 246 * @since 1.8
231 247 *
232 248 * @param array $options
249 + * @return array
233 250 */
234 251 protected function update( $options ) {
235 252 $newoptions = array();
236 253
@@ -238,8 +255,9 @@
238 255 $newoptions[ $key ] = isset( $options[ $key ] ) ? (int) $options[ $key ] : 0;
239 256 }
240 257
241 258 if ( 3 == $options['force_lang'] && isset( $options['domains'] ) && is_array( $options['domains'] ) ) {
259 + $newoptions['domains'] = array();
242 260 foreach ( $options['domains'] as $key => $domain ) {
243 261 if ( empty( $domain ) ) {
244 262 $lang = $this->model->get_language( $key );
245 263 add_settings_error(
@@ -284,8 +302,9 @@
284 302 *
285 303 * @since 1.8
286 304 *
287 305 * @param array $options new set of options to test
306 + * @return void
288 307 */
289 308 protected function check_domains( $options ) {
290 309 $options = array_merge( $this->options, $options );
291 310 $model = new PLL_Model( $options );