PluginProbe
Polylang / 3.1.4
Polylang v3.1.4
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 | include/links-default.php +16 -8 2.7.13.1.4 View file →
@@ -1,5 +1,8 @@
1 1 <?php
2 +/**
3 + * @package Polylang
4 + */
2 5
3 6 /**
4 7 * Links model for default permalinks
5 8 * for example mysite.com/?somevar=something&lang=en
@@ -7,19 +10,24 @@
7 10 *
8 11 * @since 1.2
9 12 */
10 13 class PLL_Links_Default extends PLL_Links_Model {
14 + /**
15 + * Tells this child class of PLL_Links_Model does not use pretty permalinks.
16 + *
17 + * @var bool
18 + */
11 19 public $using_permalinks = false;
12 20
13 21 /**
14 - * Adds language information to an url
15 - * links_model interface
22 + * Adds the language code in a url.
23 + * links_model interface.
16 24 *
17 25 * @since 1.2
18 26 *
19 - * @param string $url url to modify
20 - * @param object $lang language
21 - * @return string modified url
27 + * @param string $url The url to modify.
28 + * @param PLL_Language $lang The language object.
29 + * @return string Modified url.
22 30 */
23 31 public function add_language_to_link( $url, $lang ) {
24 32 return empty( $lang ) || ( $this->options['hide_default'] && $this->options['default_lang'] == $lang->slug ) ? $url : add_query_arg( 'lang', $lang->slug, $url );
25 33 }
@@ -82,14 +90,14 @@
82 90 return preg_match( $pattern, trailingslashit( $url ), $matches ) ? $matches[1] : ''; // $matches[1] is the slug of the requested language
83 91 }
84 92
85 93 /**
86 - * Returns the static front page url
94 + * Returns the static front page url.
87 95 *
88 96 * @since 1.8
89 97 *
90 - * @param object $lang
91 - * @return string
98 + * @param PLL_Language $lang The language object.
99 + * @return string The static front page url.
92 100 */
93 101 public function front_page_url( $lang ) {
94 102 if ( $this->options['hide_default'] && $lang->slug == $this->options['default_lang'] ) {
95 103 return trailingslashit( $this->home );