| @@ -226,9 +226,9 @@ | ||
| 226 | 226 | public function translate_labels( $type ) { |
| 227 | 227 | // Use static array to avoid translating several times the same ( default ) labels |
| 228 | 228 | static $translated = array(); |
| 229 | 229 | |
| 230 | - foreach ( $type->labels as $key => $label ) { | |
| 230 | + foreach ( (array) $type->labels as $key => $label ) { | |
| 231 | 231 | if ( is_string( $label ) && isset( $this->labels[ $label ] ) ) { |
| 232 | 232 | if ( empty( $translated[ $label ] ) ) { |
| 233 | 233 | // PHPCS:disable WordPress.WP.I18n |
| 234 | 234 | $type->labels->$key = $translated[ $label ] = isset( $this->labels[ $label ]['context'] ) ? |