HTML
1 year ago
views
5 months ago
Apply.php
6 months ago
Cron.php
1 year ago
CronJob.php
7 months ago
CronJobs.php
2 months ago
Crypt.php
1 month ago
DownloadStats.php
5 months ago
Email.php
5 days ago
EmailCron.php
1 year ago
FileSystem.php
1 year ago
Installer.php
1 day ago
Messages.php
1 year ago
Query.php
4 months ago
Session.php
1 day ago
Settings.php
4 years ago
SimpleMath.php
4 years ago
TempStorage.php
1 day ago
Template.php
5 months ago
UI.php
6 months ago
Updater.php
4 years ago
UserAgent.php
2 years ago
__.php
1 month ago
__MailUI.php
3 years ago
Settings.php
60 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace WPDM\__; |
| 5 | |
| 6 | class Settings |
| 7 | { |
| 8 | |
| 9 | function __construct() |
| 10 | { |
| 11 | } |
| 12 | |
| 13 | function get($name, $default = ''){ |
| 14 | $value = get_option($name); |
| 15 | $value = htmlspecialchars_decode($value); |
| 16 | $value = stripslashes_deep($value); |
| 17 | $value = wpdm_escs($value); |
| 18 | return $value; |
| 19 | } |
| 20 | |
| 21 | function __get($name) |
| 22 | { |
| 23 | $name = "__wpdm_".$name; |
| 24 | $value = get_option($name); |
| 25 | $value = maybe_unserialize($value); |
| 26 | if(!is_array($value)) { |
| 27 | $value = htmlspecialchars_decode($value); |
| 28 | $value = stripslashes_deep($value); |
| 29 | $value = wpdm_escs($value); |
| 30 | } |
| 31 | return $value; |
| 32 | } |
| 33 | |
| 34 | function __call($name, $args = null) |
| 35 | { |
| 36 | $name = "__wpdm_".$name; |
| 37 | $value = get_option($name); |
| 38 | if($args === null) { |
| 39 | $value = htmlspecialchars_decode($value); |
| 40 | $value = stripslashes_deep($value); |
| 41 | $value = wpdm_escs($value); |
| 42 | } else { |
| 43 | $value = wpdm_sanitize_var($value, $args[0]); |
| 44 | } |
| 45 | return $value; |
| 46 | } |
| 47 | |
| 48 | static function __callStatic($name, $args = null) |
| 49 | { |
| 50 | $name = "__wpdm_".$name; |
| 51 | $value = get_option($name); |
| 52 | $value = htmlspecialchars_decode($value); |
| 53 | $value = stripslashes_deep($value); |
| 54 | $value = wpdm_escs($value); |
| 55 | return $value; |
| 56 | } |
| 57 | |
| 58 | |
| 59 | } |
| 60 |