PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.16.0
GiveWP – Donation Plugin and Fundraising Platform v2.16.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Tracking / Repositories / Settings.php

Settings.php in GiveWP – Donation Plugin and Fundraising Platform 2.16.0, at src/Tracking/Repositories/Settings.php

62 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Tracking\Repositories;
4
5 /**
6 * Class Settings
7 * @package Give\Tracking\Repositories
8 *
9 * @since 2.10.0
10 */
11 class Settings {
12 const USAGE_TRACKING_OPTION_KEY = 'usage_tracking';
13 const USAGE_TRACKING_NOTICE_NAG_OPTION_KEY = 'give_telemetry_hide_usage_tracking_notice';
14
15 /**
16 * Return "usage_tracking" give setting option value.
17 *
18 * @since 2.10.0
19 * @return string
20 */
21 public function getUsageTrackingOptionValue() {
22 return give_get_option( self::USAGE_TRACKING_OPTION_KEY, 'disabled' );
23 }
24
25 /**
26 * Get "give_telemetry_hide_usage_tracking_notice" option value.
27 *
28 * @since 2.10.0
29 *
30 * @return string
31 */
32 public function getUsageTrackingNoticeNagOptionValue() {
33 return get_option( self::USAGE_TRACKING_NOTICE_NAG_OPTION_KEY, null );
34 }
35
36 /**
37 * Store "usage_tracking" give setting option value.
38 *
39 * @since 2.10.0
40 *
41 * @param $optionValue
42 *
43 * @return boolean
44 */
45 public function saveUsageTrackingOptionValue( $optionValue ) {
46 return give_update_option( self::USAGE_TRACKING_OPTION_KEY, $optionValue );
47 }
48
49 /**
50 * Store "give_hide_usage_tracking_notice" option value.
51 *
52 * @since 2.10.0
53 *
54 * @param int $optionValue
55 *
56 * @return string
57 */
58 public function saveUsageTrackingNoticeNagOptionValue( $optionValue ) {
59 return update_option( self::USAGE_TRACKING_NOTICE_NAG_OPTION_KEY, $optionValue, false );
60 }
61 }
62