WP_Translation_File_PHP::parse_file
Parses the file.
Метод класса: WP_Translation_File_PHP{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->parse_file();
Список изменений
| С версии 6.5.0 | Введена. |
Код WP_Translation_File_PHP::parse_file() WP Translation File PHP::parse file WP 7.0.4
protected function parse_file() {
$this->parsed = true;
$result = include $this->file;
if ( ! $result || ! is_array( $result ) ) {
$this->error = 'Invalid data';
return;
}
if ( isset( $result['messages'] ) && is_array( $result['messages'] ) ) {
foreach ( $result['messages'] as $original => $translation ) {
$this->entries[ (string) $original ] = $translation;
}
unset( $result['messages'] );
}
$this->headers = array_change_key_case( $result );
}