(function ($) {
	"use strict";

	function dismissNotice(callback) {

		$.post(
			nova_photography_portfolio_localize.ajax_url,
			{
				action: 'nova_photography_portfolio_dismiss_admin_notice',
				nonce: nova_photography_portfolio_localize.nonce
			},
			function () {
				if (typeof callback === 'function') {
					callback();
				}
			}
		);
	}

	$('.nova-photography-portfolio-get-started').on('click', function (e) {
		e.preventDefault();

		var redirect = $(this).attr('href');

		dismissNotice(function () {
			window.location.href = redirect;
		});
	});

	$(document).on('click', '.notice-get-started-class .notice-dismiss', function () {
		dismissNotice();
	});

})(jQuery);