config
4 years ago
notices
1 month ago
Config.php
1 month ago
Dismissed.php
1 month ago
Display.php
1 month ago
Loader.php
1 month ago
MessageTexts.php
1 month ago
PageConfig.php
1 month ago
ScreenConfig.php
1 month ago
Store.php
1 month ago
Store.php
19 lines
| 1 | <?php |
| 2 | |
| 3 | namespace OTGS\Installer\AdminNotices; |
| 4 | |
| 5 | class Store { |
| 6 | const ADMIN_NOTICES_OPTION = 'otgs_installer_admin_notices'; |
| 7 | |
| 8 | public function save( $key, $data ) { |
| 9 | $current = get_option( self::ADMIN_NOTICES_OPTION, [] ); |
| 10 | $current[ $key ] = $data; |
| 11 | update_option( self::ADMIN_NOTICES_OPTION, $current, 'no' ); |
| 12 | } |
| 13 | |
| 14 | public function get( $key, $default ) { |
| 15 | $current = get_option( self::ADMIN_NOTICES_OPTION, [] ); |
| 16 | return isset( $current[$key] ) ? $current[$key] : $default; |
| 17 | } |
| 18 | } |
| 19 |