-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrestrictcontent.php
76 lines (63 loc) · 2.34 KB
/
restrictcontent.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Plugin Name: Restrict Content
* Plugin URL: http://pippinsplugins.com/restricted-content-plugin-free/
* Description: Restrict Content to registered users only. This is a simple plugin that will allow you to easily restrict complete posts / pages to logged in users only.
* Version: 2.2.4
* Author: Sandhills Development, LLC
* Author URI: https://sandhillsdev.com
* Contributors: mordauk
* Tags: Restrict content, member only, registered, logged in, restricted access, restrict access, limiit access, read-only, read only
*/
/*******************************************
* global variables
*******************************************/
// load the plugin options
$rc_options = get_option( 'rc_settings' );
if ( ! defined( 'RC_PLUGIN_VERSION' ) ) {
define( 'RC_PLUGIN_VERSION', '2.2.4' );
}
if ( ! defined( 'RC_PLUGIN_DIR' ) ) {
define( 'RC_PLUGIN_DIR', dirname(__FILE__) );
}
if ( ! defined( 'RC_PLUGIN_URL' ) ) {
define( 'RC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
/**
* Load textdomain
*
* @return void
*/
function rc_textdomain() {
// Set filter for plugin's languages directory
$rc_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
$rc_lang_dir = apply_filters( 'rc_languages_directory', $rc_lang_dir );
// Load the translations
load_plugin_textdomain( 'restrict-content', false, $rc_lang_dir );
}
add_action( 'init', 'rc_textdomain' );
/*******************************************
* file includes
*******************************************/
require_once RC_PLUGIN_DIR . '/includes/misc-functions.php';
require_once RC_PLUGIN_DIR . '/includes/forms.php';
require_once RC_PLUGIN_DIR . '/includes/scripts.php';
require_once RC_PLUGIN_DIR . '/includes/upgrades.php';
require_once RC_PLUGIN_DIR . '/includes/integrations.php';
include(RC_PLUGIN_DIR . '/includes/settings.php');
include(RC_PLUGIN_DIR . '/includes/shortcodes.php');
include(RC_PLUGIN_DIR . '/includes/metabox.php');
include(RC_PLUGIN_DIR . '/includes/display-functions.php');
include(RC_PLUGIN_DIR . '/includes/feed-functions.php');
include(RC_PLUGIN_DIR . '/includes/user-checks.php');
/**
* Deactivates the plugin if Restrict Content Pro is activated.
*
* @since 2.2.1
*/
function rc_deactivate_plugin() {
if ( defined( 'RCP_PLUGIN_VERSION' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
}
}
add_action( 'admin_init', 'rc_deactivate_plugin' );