public function update_changelog($new_dir) { if (file_exists(trailingslashit($new_dir) . 'readme.txt')) { if (!class_exists('Automattic_Readme')) { include_once EDD_GIT_PLUGIN_DIR . 'includes/parse-readme.php'; } $Parser = new Automattic_Readme(); $content = $Parser->parse_readme(trailingslashit($new_dir) . 'readme.txt'); if (isset($content['sections']['changelog'])) { $changelog = wp_kses_post($content['sections']['changelog']); update_post_meta($this->instance->download_id, '_edd_sl_changelog', $changelog); $this->instance->changelog = $changelog; } } }
<?php /** Template version: 1.0.0 */ ?> <?php include CUAR_PLUGIN_DIR . '/libs/automattic/parse-readme.php'; $parser = new Automattic_Readme(); $readme = $parser->parse_readme(CUAR_PLUGIN_DIR . '/readme.txt'); echo $readme['sections']['changelog'];