<?php
/**
 * Changelog
 */

$munding = wp_get_theme( 'munding-lite' );

?>
<div class="munding-tab-pane" id="changelog">

	<div class="munding-tab-pane-center">
	
		<h1><?php echo esc_attr( $munding['Name'] ); ?> <?php if( !empty($munding['Version']) ): ?> <sup id="munding-theme-version"><?php echo esc_attr( $munding['Version'] ); ?> </sup><?php endif; ?></h1>

	</div>

	<?php
	WP_Filesystem();
	global $wp_filesystem;
	$munding_lite_changelog = $wp_filesystem->get_contents( get_template_directory().'/changelog.txt' );
	$munding_lite_changelog_lines = explode(PHP_EOL, $munding_lite_changelog);
	foreach($munding_lite_changelog_lines as $munding_lite_changelog_line){
		if(substr( $munding_lite_changelog_line, 0, 3 ) === "###"){
			echo '<hr /><h1>'.substr($munding_lite_changelog_line,3).'</h1>';
		} else {
			echo $munding_lite_changelog_line,'<br/>';
		}
	}

	?>
	
</div>