*/ class Latest_Updates extends Notice { public $color = 'info'; private $version_option_key = 'jltma_latest_updates_notice_version'; /** * Latest Updates Notice * * @return void */ public function __construct() { $this->maybe_reset_for_new_version(); parent::__construct(); } /** * Reset notice data when plugin version changes so the notice * re-appears after every update. * * @return void */ private function maybe_reset_for_new_version() { if (!defined('JLTMA_VER')) { return; } $stored_version = get_option($this->version_option_key); if ($stored_version === JLTMA_VER) { return; } // Version changed — delete old notice data so init() rebuilds it fresh. delete_option('jltma_notice_' . strtolower((new \ReflectionClass($this))->getShortName())); update_option($this->version_option_key, JLTMA_VER); } /** * Notice Content * * @author Jewel Theme */ public function notice_content() { $jltma_changelog_message = sprintf( /* translators: 1: URL to changelogs page, 2: Link text for changelogs, 3: Plugin name and version heading HTML, 4: First changelog item HTML, 5: Second changelog item HTML */ __('%3$s %4$s
Check Changelogs for %2$s', 'master-addons'), esc_url_raw('https://master-addons.com/changelogs'), __('More Details', 'master-addons'), /** Changelog Items * Starts from: %3$s */ '

' . JLTMA . ' v' . esc_html(JLTMA_VER) . '' . __(' has some updates..', 'master-addons') . '


', // %3$s // Changelogs __(' Security: Security update.
', 'master-addons') . __(' Changed: Custom CSS Pro to Free.
', 'master-addons') ); printf(wp_kses_post($jltma_changelog_message)); } /** * Intervals * * @author Jewel Theme */ public function intervals() { return array(0); } } }