bullet; $indent = str_repeat( ' ', strlen( $bullet ) ); $subheading_map = $this->getSubheadingTypeMapping(); foreach ( $changelog->getEntries() as $entry ) { $version = $entry->getVersion(); if ( substr_count( $version, '.' ) === 1 ) { $version .= '.0'; } $ret .= "= $version YYYY-mm-dd =\n\n"; $ret .= "**WooCommerce**\n\n"; foreach ( $entry->getChangesBySubheading() as $heading => $changes ) { foreach ( $changes as $change ) { $text = trim( $change->getContent() ); $type = isset( $subheading_map[ $heading ] ) ? $subheading_map[ $heading ] : 'update'; if ( '' !== $text ) { $preamble = $bullet . ucfirst( $type ) . ' - '; $ret .= $preamble . str_replace( "\n", "\n$indent", $text ) . "\n"; } } } $ret = trim( $ret ) . "\n\n"; } $ret = trim( $ret ) . "\n"; return $ret; } }