PluginProbe
Polylang / 2.8
Polylang v2.8
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-subdomain.php +9 -15 3.02.8 View file →
@@ -10,22 +10,16 @@
10 10 *
11 11 * @since 1.2
12 12 */
13 13 class PLL_Links_Subdomain extends PLL_Links_Abstract_Domain {
14 - /**
15 - * Stores whether the home url includes www. or not.
16 - * Either '://' or '://www.'.
17 - *
18 - * @var string
19 - */
20 14 protected $www;
21 15
22 16 /**
23 - * Constructor.
17 + * Constructor
24 18 *
25 19 * @since 1.7.4
26 20 *
27 - * @param PLL_Model $model Instance of PLL_Model.
21 + * @param object $model PLL_Model instance
28 22 */
29 23 public function __construct( &$model ) {
30 24 parent::__construct( $model );
31 25 $this->www = ( false === strpos( $this->home, '://www.' ) ) ? '://' : '://www.';
@@ -31,16 +25,16 @@
31 25 $this->www = ( false === strpos( $this->home, '://www.' ) ) ? '://' : '://www.';
32 26 }
33 27
34 28 /**
35 - * Adds the language code in a url.
36 - * links_model interface.
29 + * Adds the language code in url
30 + * links_model interface
37 31 *
38 32 * @since 1.2
39 33 *
40 - * @param string $url The url to modify.
41 - * @param PLL_Language $lang The language object.
42 - * @return string Modified url.
34 + * @param string $url url to modify
35 + * @param object $lang language
36 + * @return string modified url
43 37 */
44 38 public function add_language_to_link( $url, $lang ) {
45 39 if ( ! empty( $lang ) && false === strpos( $url, '://' . $lang->slug . '.' ) ) {
46 40 $url = $this->options['default_lang'] == $lang->slug && $this->options['hide_default'] ? $url : str_replace( $this->www, '://' . $lang->slug . '.', $url );
@@ -73,13 +67,13 @@
73 67 return $url;
74 68 }
75 69
76 70 /**
77 - * Get hosts managed on the website.
71 + * Get hosts managed on the website
78 72 *
79 73 * @since 1.5
80 74 *
81 - * @return string[] The list of hosts.
75 + * @return array list of hosts
82 76 */
83 77 public function get_hosts() {
84 78 $hosts = array();
85 79 foreach ( $this->model->get_languages_list() as $lang ) {