Notifications.php
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Tz\WordPress\Tools\Notifications;
use Tz\WordPress\Tools;
use Tz\Common;
const OPTION_NAME = "notif_options";
call_user_func(function() {
Vars::$options = new Tools\WP_Option(OPTION_NAME);
if (is_admin()) {
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'Validation.php');
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'Admin.php');
}
});
/**
Send Notifications
@trigger = notification unique slug name
@user = user id (to get email and name)
@type = instant or cron
*/
function send_notification($trigger="NO_TRIGGER",$user=0,$type="instant") {
}
function current_url() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
class Vars {
public static $options;
}
?>