ID; $ignored_notice = get_user_meta($user_id, 'broadnews_ignore_theme_review_notice', true); $ignored_notice_partially = get_user_meta($user_id, 'nag_broadnews_ignore_theme_review_notice_partially', true); /** * Return from notice display if: * * 1. The theme installed is less than 5 day ago. * 2. If the user has ignored the message partially for 2 day. * 3. Dismiss always if clicked on 'Already Done' button. */ if ((get_option('broadnews_theme_installed_time') > strtotime('-7 days')) || ($ignored_notice_partially > strtotime('-3 days')) || ($ignored_notice)) { return; } ?>
ID; /* If user clicks to ignore the notice, add that to their user meta */ if (isset($_GET['nag_broadnews_ignore_theme_review_notice']) && '0' == $_GET['nag_broadnews_ignore_theme_review_notice']) { add_user_meta($user_id, 'broadnews_ignore_theme_review_notice', 'true', true); } } /** * Function to remove the theme review notice partially as requested by the user. */ public function broadnews_ignore_theme_review_notice_partially() { global $current_user; $user_id = $current_user->ID; /* If user clicks to ignore the notice, add that to their user meta */ if (isset($_GET['nag_broadnews_ignore_theme_review_notice_partially']) && '0' == $_GET['nag_broadnews_ignore_theme_review_notice_partially']) { update_user_meta($user_id, 'nag_broadnews_ignore_theme_review_notice_partially', time()); } } /** * Remove the data set after the theme has been switched to other theme. */ public function broadnews_theme_rating_notice_data_remove() { $get_all_users = get_users(); $theme_installed_time = get_option('broadnews_theme_installed_time'); // Delete options data. if ($theme_installed_time) { delete_option('broadnews_theme_installed_time'); } // Delete user meta data for theme review notice. foreach ($get_all_users as $user) { $ignored_notice = get_user_meta($user->ID, 'broadnews_ignore_theme_review_notice', true); $ignored_notice_partially = get_user_meta($user->ID, 'nag_broadnews_ignore_theme_review_notice_partially', true); // Delete permanent notice remove data. if ($ignored_notice) { delete_user_meta($user->ID, 'broadnews_ignore_theme_review_notice'); } // Delete partial notice remove data. if ($ignored_notice_partially) { delete_user_meta($user->ID, 'nag_broadnews_ignore_theme_review_notice_partially'); } } } } new BroadNews_Theme_Review_Notice();