'.$user_message.'';
return $code;
}
public static function dismiss_notice() {
//update_option('essb3-activate-notice', 'true');
set_transient('essb3-activate-notice', 'true', 336 * HOUR_IN_SECONDS);
}
public static function notice_activate() {
if (ESSBActivationManager::isThemeIntegrated()) {
return;
}
$options_slug = essb_show_welcome() ? 'essb_redirect_social' : 'essb_options';
$dismiss_url = esc_url_raw(add_query_arg(array('dismissactivate' => 'true'), admin_url ("admin.php?page=".$options_slug)));
//$update_url = esc_url_raw(admin_url ("admin.php?page=essb_redirect_update&tab=update"));
$dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . '';
echo '';
}
public static function notice_manager() {
$dismiss_translate = isset($_REQUEST['dismiss_translate']) ? $_REQUEST['dismiss_translate'] : '';
if ($dismiss_translate == 'true') {
self::dismiss_notice_translate();
}
$dismiss_subscribe = isset($_REQUEST['dismiss_subscribe']) ? $_REQUEST['dismiss_subscribe'] : '';
if ($dismiss_subscribe == 'true') {
//self::dismiss_notice_subscribe();
}
// notice display
if (self::should_display_notice_translate()) {
self::notice_translate();
}
if (self::should_display_notice_subscribe()) {
//self::notice_subscribe();
}
}
public static function should_display_notice_translate() {
return false;
/*$notice_dismissed = get_option('essb3-translate-notice');
if ($notice_dismissed === false) {
return true;
}
else {
return false;
}*/
}
public static function dismiss_notice_translate() {
update_option('essb3-translate-notice', 'true');
}
public static function notice_translate() {
$dismiss_url = esc_url_raw(add_query_arg(array('dismiss_translate' => 'true'), admin_url ("admin.php?page=essb_options")));
$dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . '';
echo '';
}
public static function should_display_notice_subscribe() {
return false;
/*$notice_dismissed = get_option('essb3-subscribe-notice');
if ($notice_dismissed === false) {
return true;
}
else {
return false;
}*/
}
public static function dismiss_notice_subscribe() {
update_option('essb3-subscribe-notice', 'true');
}
public static function notice_subscribe() {
$code = '';
$dismiss_url = esc_url_raw(add_query_arg(array('dismiss_subscribe' => 'true'), admin_url ("admin.php?page=essb_options")));
$dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . '';
echo '';
}
public static function notice_new_addons() {
if (ESSB3_ADDONS_ACTIVE && class_exists('ESSBAddonsHelper')) {
$addons = ESSBAddonsHelper::get_instance();
$new_addons = $addons->get_new_addons();
$new_addons_count = $addons->get_new_addons_count();
if ($new_addons_count > 0) {
$dismiss_keys = "";
$new_addons_list = "";
$cnt = 0;
foreach ($new_addons as $key => $data) {
if ($dismiss_keys != "") {
$dismiss_keys .= ',';
}
$dismiss_keys .= $key;
$cnt++;
if ($new_addons_list != '') {
$new_addons_list .= ', ';
}
$new_addons_list .= sprintf('%1$s', $data['title'], admin_url ("admin.php?page=essb_addons"));
}
$single_text = __('New extension for Easy Social Share Buttons for WordPress is available!', 'essb');
$plural_text = __('New extensions for Easy Social Share Buttons for WordPress are available! ', 'essb');
$display_text = ($cnt > 1) ? $plural_text : $single_text;
$display_text = $cnt. ' '.$display_text;
if (essb_show_welcome()) {
$dismiss_url = esc_url_raw(add_query_arg(array('dismiss' => 'true', 'addon' => $dismiss_keys), admin_url ("admin.php?page=essb_redirect_social&tab=social")));
}
else {
$dismiss_url = esc_url_raw(add_query_arg(array('dismiss' => 'true', 'addon' => $dismiss_keys), admin_url ("admin.php?page=essb_options")));
}
$all_addons_button = ' ' . __ ( 'View list of all extensions', 'essb' ) . '';
$dismiss_addons_button = ' '.__('Hide message', 'essb').'';
$buttons_container = ''.$all_addons_button.$dismiss_addons_button.'
';
//printf ( '', $display_text, $new_addons_list, $dismiss_addons_button, '95%', '5%' );
echo '';
}
}
}
}
?>