| @@ -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; |