-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp-content-restriction.php
59 lines (54 loc) · 1.69 KB
/
wp-content-restriction.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
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* WP Content Restriction
*
* Plugin Name: WP Content Restriction
* Description: Restrict your content, pass after read notice or alert.
* Author: Hiram Huang <[email protected]>
* Author URI: https://www.facebook.com/naxqihao
* Version: 0.1
* Text Domain: wp-content-restriction
* Domain Path: /languages
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
*
* @author Hiram Huang <[email protected]>
* @package wp-content-restriction
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @link Github Repo: https://github.com/chown9835/wp-content-restriction
* @since 0.1
*/
/**
* If file is opened directly, return 403 error
*/
if( ! function_exists ('add_action') ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
/**
* Defines plugin named constant
*/
define( 'CR_PLUGIN_VERSION', 0.1 );
define( 'CR_PLUGIN_PATH_FULL', __FILE__ );
define( 'CR_PLUGIN_BASE_FULL', dirname(__FILE__) );
define( 'CR_PLUGIN_BASE_RELATIVE', plugin_basename(__FILE__) );
define( 'CR_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
define( 'CR_PLUGIN_TEXT_DOMAIN', 'wp-content-restriction' );
/**
* Load languages
*/
function load_languages() {
load_plugin_textdomain( CR_PLUGIN_TEXT_DOMAIN, false, CR_PLUGIN_FILE_BASENAME . '/languages' );
}
add_action( 'plugins_loaded', 'load_languages' );
/**
* Import plugin classes.
*/
include_once( CR_PLUGIN_BASE_FULL . '/settings/class-wp-content-restriction-settings.php' );
include_once( CR_PLUGIN_BASE_FULL . '/includes/class-wp-content-restriction-filter.php' );
/**
* Initial plugin.
*/
WP_Content_Restriction_Settings::init();
WP_Content_Restriction_Filter::init();