saveNoticeExpires(); return; } if ((get_option(ACFBS_NOTICE, 0) >= time()) || (get_current_screen()->id != 'dashboard')) { return; } require_once ACFBS_PATH . 'resources/components/notice/thanks.php'; } public function showAdminError() { if (function_exists('acf_get_setting')) return; require_once ACFBS_PATH . 'resources/components/notice/acf.php'; } /* --- Turn off notice --- */ public function hideNoticeByDefault() { if (get_option(ACFBS_NOTICE, false) !== false) return; $expires = strtotime('+ 1 week'); $this->saveNoticeExpires($expires); } public function hideNotice() { $isPermanent = isset($_POST['is_permanently']) && $_POST['is_permanently']; $expires = strtotime($isPermanent ? '+10 years' : '+ 1 month'); $this->saveNoticeExpires($expires); } public function saveNoticeExpires($expires = 0) { $expires = $expires ? $expires : strtotime('+ 1 week'); if (get_option(ACFBS_NOTICE, false) !== false) update_option(ACFBS_NOTICE, $expires); else add_option(ACFBS_NOTICE, $expires); } }