<?php 
add_action('admin_notices','edumodo_admin_notice');
add_action('admin_init','edumodo_dismiss_admin_notice');


function edumodo_admin_notice(){
	//delete_option('notice_dissmissed');
	if (get_option("edumodo-update-notice")) {
		return;
	}
	$notice_container = 
	<<<EOD
	<div class="edumodo-thank-you-notice notice is-dismissible %s uniqueclass">
	<h2>%s</h2>
	<p>%s</p>
	<a target="_blank" href="%s">%s</a>
	<h4></h4>
	</div>
EOD;
	$heading = 'Edumodo 4.0 - Major Update';
	$notice = "Introducing new customizer panel in edumodo 4.0. We converted all of our setting options from Redux to WordPress default customizer. Now you get all of your site custimization options in one place. Our easy to use customizer option panel let you control every important part of your site.";
	$ticket_link = 'https://www.themexpert.com/envato';
	$ticket_text = 'Get Support';
	printf($notice_container, "notice-info", $heading, $notice, $ticket_link, $ticket_text);

}


function edumodo_dismiss_admin_notice(){
	if( isset($_GET['dismissed']) && $_GET['dismissed'] == 1 ){
		update_option('edumodo-update-notice', 1);
	}
}
