-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbs-check-dma.php
48 lines (36 loc) · 1.14 KB
/
pbs-check-dma.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
<?php
/*
* Plugin Name: PBS Check DMA
* Version: 0.94 - adding function to return list of station ids in a state
* Plugin URI: http://ieg.wnet.org/
* Description: Use geolocation to restrict content based on a PBS stations' DMA
* Author: William Tam
* Author URI: http://ieg.wnet.org/
* Requires at least: 4.0
* Tested up to: 4.2.2
*
* @package WordPress
* @author William Tam
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit;
// Include plugin class files
require_once( 'classes/class-pbs-check-dma.php' );
require_once( 'classes/class-pbs-check-dma-settings.php' );
global $plugin_obj;
$plugin_obj = new PBS_Check_DMA( __FILE__ );
if ( is_admin() ) {
$plugin_settings_obj = new PBS_Check_DMA_Settings( __FILE__ );
}
// always cleanup after yourself
register_deactivation_hook(__FILE__, 'pbs_check_dma_deactivation');
function pbs_check_dma_deactivation() {
//tk
}
register_activation_hook(__FILE__, 'pbs_check_dma_activation');
function pbs_check_dma_activation() {
// init the object, which will setup the object
$plugin_obj = new PBS_Check_DMA( __FILE__ );
$plugin_obj->setup_rewrite_rules();
flush_rewrite_rules();
}