PHP code example of mjkhajeh / changelog

1. Go to this page and download the library: Download mjkhajeh/changelog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mjkhajeh / changelog example snippets








use MJ\Changelog\AbstractChangelog;

class Changelog extends AbstractChangelog {
	static string $name = 'example_changelog';
	static bool $dev_mode = true;
	static string $current_version = '1.2.0.0';
	static string $dir = __DIR__ . '/example/';
	static string $menu_parent = 'options-general.php';
	static string $menu_slug = 'changelogs';
	static string $logo_url = plugin_dir_url( __FILE__ ) . 'assets/img/logo.svg';
	static string $css_url = plugin_dir_url( __FILE__ ) . 'libs/vendor/mjkhajeh/changelog/assets/css/changelog.min.css';
	static string $js_file = plugin_dir_url( __FILE__ ) . 'libs/vendor/mjkhajeh/changelog/assets/js/changelog';
	static string $rtl_page = 'https://www.rtl-theme.com';
	static string $last_updated_version_option_name = 'project_last_updated_version';
	static string $last_showed_changelog_option_name = 'project_last_showed_changelog';

	public static function i18n() : array {
		return [
			'page_title'        => __( 'Changelogs', 'textdomain' ),
			'menu_title'        => __( 'Changelogs', 'textdomain' ),
			'current_version'   => __( 'Current version: %s', 'textdomain' ),
			'submit_score'      => __( 'Submit your score', 'textdomain' ),
			'update_successful' => __( 'Project has been successfully updated. View the changelog for version %s:', 'textdomain' ),
			'show_changelogs'   => __( 'Show more changelogs', 'textdomain' ),
		];
	}
}

Changelog::init();

update_option( 'project_last_updated_version', '1.2.0.0', false );
text
V{VERSION_WITH_UNDERSCORES}.json
text
V1_0_0_0.json
V1_1_0_0.json
V1_2_0_0.json