-
Notifications
You must be signed in to change notification settings - Fork 0
/
purecharity-wp-givingcircles.php
executable file
·129 lines (114 loc) · 4.02 KB
/
purecharity-wp-givingcircles.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* Dashboard. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://purecharity.com
* @since 1.0.0
* @package Purecharity_Wp_Givingcircles
*
* @wordpress-plugin
* Plugin Name: Pure Charity Giving Circles
* Plugin URI: http://purecharity.com/purecharity-wp-givingcircles-uri/
* Description: Pure Charity Giving Circles integrations via shortcodes to display a Giving Circle or a list of your Giving Circles inside a page
* Version: 1.2.2
* Author: Pure Charity
* Author URI: http://purecharity.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: purecharity-wp-givingcircles
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* The Shortcodes handler class.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/shortcode.class.php';
/**
* The template tags class.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/template_tags.php';
/**
* The code that runs during plugin activation.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/activator.class.php';
/**
* The code that runs during plugin deactivation.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/deactivator.class.php';
/** This action is documented in includes/purecharity-wp-givingcircles-activator.class.php */
register_activation_hook( __FILE__, array( 'Purecharity_Wp_Givingcircles_Activator', 'activate' ) );
/** This action is documented in includes/purecharity-wp-givingcircles-deactivator.class.php */
register_deactivation_hook( __FILE__, array( 'Purecharity_Wp_Givingcircles_Deactivator', 'deactivate' ) );
/**
* The core plugin class that is used to define internationalization,
* dashboard-specific hooks, and public-facing site hooks.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/purecharity-wp-givingcircles.class.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_purecharity_wp_givingcircles() {
$plugin = new Purecharity_Wp_Givingcircles();
$plugin->run();
}
run_purecharity_wp_givingcircles();
register_activation_hook( __FILE__, array( 'Purecharity_Wp_Givingcircles', 'activation_check' ) );
/**
* Force the use of a specific template
*
* @since 1.1.1
*/
function gc_force_template() {
try{
$options = get_option( 'purecharity_giving_circles_settings' );
if($options['single_view_template'] == 'purecharity-plugin-template.php'){
include(purecharity_plugin_template());
}else{
include(TEMPLATEPATH . '/' . $options['single_view_template']);
}
exit;
}
catch(Exception $e){
echo "Custom template invalid.";
}
}
/*
* Plugin updater using GitHub
*
* Auto Updates through GitHub
*
* @since 1.1.2
*/
add_action( 'init', 'purecharity_wp_givingcircles_updater' );
function purecharity_wp_givingcircles_updater() {
if ( is_admin() ) {
$gc_config = array(
'slug' => plugin_basename( __FILE__ ),
'proper_folder_name' => 'purecharity-wp-givingcircles',
'api_url' => 'https://api.github.com/repos/purecharity/pure-givingcircles',
'raw_url' => 'https://raw.githubusercontent.com/purecharity/pure-givingcircles/master/purecharity-wp-givingcircles/',
'github_url' => 'https://github.com/purecharity/pure-givingcircles',
'zip_url' => 'https://github.com/purecharity/pure-givingcircles/archive/master.zip',
'sslverify' => true,
'requires' => '3.0',
'tested' => '3.3',
'readme' => 'README.md',
'access_token' => '',
);
new WP_GitHub_Updater( $gc_config );
}
}