ACF_Admin_Updates::get_changelog_changes
get_changelog_changes
Finds the specific changes for a given version from the provided changelog snippet.
Method of the class: ACF_Admin_Updates{}
No Hooks.
Returns
String.
Usage
$ACF_Admin_Updates = new ACF_Admin_Updates(); $ACF_Admin_Updates->get_changelog_changes( $changelog, $version );
- $changelog(string)
- The changelog text.
Default:'' - $version(string)
- The version to find.
Default:''
Changelog
| Since 5.7.10 | Introduced. |
ACF_Admin_Updates::get_changelog_changes() ACF Admin Updates::get changelog changes code ACF 6.8.8
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 '';
}