ACF_Admin_Updates::get_changelog_changes
get_changelog_changes
Finds the specific changes for a given version from the provided changelog snippet.
Метод класса: ACF_Admin_Updates{}
Хуков нет.
Возвращает
Строку.
Использование
$ACF_Admin_Updates = new ACF_Admin_Updates(); $ACF_Admin_Updates->get_changelog_changes( $changelog, $version );
- $changelog(строка)
- The changelog text.
По умолчанию:'' - $version(строка)
- The version to find.
По умолчанию:''
Список изменений
| С версии 5.7.10 | Введена. |
Код ACF_Admin_Updates::get_changelog_changes() ACF Admin Updates::get changelog changes ACF 6.4.2
function get_changelog_changes( $changelog = '', $version = '' ) {
// Explode changelog into sections.
$bits = array_filter( explode( '<h4>', $changelog ) );
// Loop over each version chunk.
foreach ( $bits as $bit ) {
// Find the version number for this chunk.
$bit = explode( '</h4>', $bit );
$bit_version = trim( $bit[0] );
$bit_text = trim( $bit[1] );
// Compare the chunk version number against param and return HTML.
if ( acf_version_compare( $bit_version, '==', $version ) ) {
return '<h4>' . esc_html( $bit_version ) . '</h4>' . acf_esc_html( $bit_text );
}
}
// Return.
return '';
}