This repository was archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommentpress-bp.php
More file actions
143 lines (87 loc) · 3.09 KB
/
Copy pathcommentpress-bp.php
File metadata and controls
143 lines (87 loc) · 3.09 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
/*
Plugin Name: Commentpress for BuddyPress
Version: 1.0
Plugin URI: http://www.futureofthebook.org/commentpress/
Description: This plugin integrates CommentPress with BuddyPress and BP Groupblog in a WordPress Multisite environment.
Author: Institute for the Future of the Book
Author URI: http://www.futureofthebook.org
Network: true
*/
// define version
define( 'CPBP_PLUGIN_VERSION', '1.0' );
// store reference to this file
if ( !defined( 'CPBP_PLUGIN_FILE' ) ) {
define( 'CPBP_PLUGIN_FILE', __FILE__ );
}
// store URL to this plugin's directory
if ( !defined( 'CPBP_PLUGIN_URL' ) ) {
define( 'CPBP_PLUGIN_URL', plugin_dir_url( CPBP_PLUGIN_FILE ) );
}
// store PATH to this plugin's directory
if ( !defined( 'CPBP_PLUGIN_PATH' ) ) {
define( 'CPBP_PLUGIN_PATH', plugin_dir_path( CPBP_PLUGIN_FILE ) );
}
/*
----------------------------------------------------------------
Init plugin
----------------------------------------------------------------
*/
// do we have our class?
if ( !class_exists( 'CommentPressBuddyPress' ) ) {
// Sanity check
// define filename
$cpbp_class_file = 'class_commentpress_bp.php';
// define path to our class file
$cpbp_class_file_path = CPBP_PLUGIN_PATH . $cpbp_class_file;
// is our class definition present?
if ( !is_file( $cpbp_class_file_path ) ) {
// oh no!
die( 'Class file "'.$cpbp_class_file.'" is missing from the plugin directory.' );
}
// Include and init
// we're fine, include class definition
require_once( $cpbp_class_file_path );
// instantiate it
$cpbp_obj = new CommentPressBuddyPress;
}
/*
--------------------------------------------------------------------------------
Misc Debugging Functions
--------------------------------------------------------------------------------
*/
/**
* @description: utility to show theme environment
* @todo:
*
*/
function _cpbp_environment() {
// don't show in admin
if ( !is_admin() ) {
// dump our environment
echo 'TEMPLATEPATH<br />'.TEMPLATEPATH.'<br /><br />';
echo 'STYLESHEETPATH<br />'.STYLESHEETPATH.'<br /><br />';
echo 'stylesheet_directory<br />'.get_bloginfo('stylesheet_directory').'<br /><br />';
echo 'template_directory<br />'.get_bloginfo('template_directory').'<br /><br />';
echo 'template_url<br />'.get_bloginfo('template_url').'<br /><br />';
echo 'stylesheet_url<br />'.get_bloginfo('stylesheet_url').'<br /><br />';
echo 'get_stylesheet_directory<br />'.get_stylesheet_directory().'<br /><br />';
echo 'get_stylesheet_directory_uri<br />'.get_stylesheet_directory_uri().'<br /><br />';
echo 'get_template_directory<br />'.get_template_directory().'<br /><br />';
echo 'get_template_directory_uri<br />'.get_template_directory_uri().'<br /><br />';
echo 'locate_template<br />'.locate_template( array( 'style/js/cp_js_common.js' ), false ).'<br /><br />';
die();
}
}
//add_action( 'template_redirect', '_cpbp_environment' );
/**
* @description: utility to show tests
* @todo:
*
*/
function _cpbp_test() {
global $commentpress_obj;
//print_r( $commentpress_obj ); die();
}
//add_action( 'wp_head', '_cpbp_test' );
?>