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/language.php +6 -8 3.03.1.4 View file →
@@ -168,9 +168,9 @@
168 168 * Url of the custom flag if it exists.
169 169 *
170 170 * @var string
171 171 */
172 - protected $custom_flag_url;
172 + public $custom_flag_url;
173 173
174 174 /**
175 175 * Html markup of the custom flag if it exists.
176 176 *
@@ -175,9 +175,9 @@
175 175 * Html markup of the custom flag if it exists.
176 176 *
177 177 * @var string
178 178 */
179 - protected $custom_flag;
179 + public $custom_flag;
180 180
181 181 /**
182 182 * Constructor: builds a language object given its two corresponding terms in 'language' and 'term_language' taxonomies.
183 183 *
@@ -186,17 +186,15 @@
186 186 * @param WP_Term|array $language Term in 'language' taxonomy or language object properties stored as an array.
187 187 * @param WP_Term $term_language Corresponding 'term_language' term.
188 188 */
189 189 public function __construct( $language, $term_language = null ) {
190 - // Build the object from all properties stored as an array.
191 - if ( is_array( $language ) ) {
190 + if ( empty( $term_language ) ) {
191 + // Build the object from all properties stored as an array.
192 192 foreach ( $language as $prop => $value ) {
193 193 $this->$prop = $value;
194 194 }
195 - }
196 -
197 - // Build the object from taxonomy terms.
198 - elseif ( ! empty( $term_language ) ) {
195 + } else {
196 + // Build the object from taxonomy terms.
199 197 $this->term_id = (int) $language->term_id;
200 198 $this->name = $language->name;
201 199 $this->slug = $language->slug;
202 200 $this->term_group = (int) $language->term_group;