-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbs-media-manager.php
50 lines (35 loc) · 1.32 KB
/
pbs-media-manager.php
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
47
<?php
/*
Plugin Name: PBS Media Manager
Description: Support functions of the PBS Media Manager API.
Author: William Tam / WNET
Version: 0.4
*/
register_activation_hook(__FILE__ , 'pbs_media_manager_install');
register_deactivation_hook(__FILE__ , 'pbs_media_manager_uninstall');
# go get everything non-admin
require_once("classes/class-pbs-media-manager.php");
# instantiate the main class
$pluginobj = new PBS_Media_Manager(__FILE__);
# Setup the settings page but only if admin
if (is_admin()) {
require_once('classes/class-pbs-media-manager-settings.php');
$settingsobj = new PBS_Media_Manager_Settings(__FILE__);
}
function pbs_media_manager_admin_notice__error() {
if (!get_option('timezone_string')){
$class = 'notice notice-error';
$message = __( 'The PBS Media Manager plugin requires the timezone name to be set. Visit the <a href=options-general.php>options page</a> and set it to something like "New York"', 'sample-text-domain' );
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
}
}
add_action( 'admin_notices', 'pbs_media_manager_admin_notice__error' );
# decide whether to display windowed passport videos
# on install/activate
function pbs_media_manager_install() {
// nothing for now
}
# on uninstall/deactivate
function pbs_media_manager_uninstall() {
// nothing for now
}