-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathloader.php
100 lines (79 loc) · 3.59 KB
/
loader.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
<?php
/*
Plugin Name: BuddyPress Wall
Plugin URI:
Description: Turn your Buddypress Activity Component to a Facebook-style Wall.
Profiles with Facebook-style walls
Version: 0.9.1
Requires at least: WP 3.4, BuddyPress 1.5
Tested up to: BuddyPress 1.9
License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
Author: Meg@Info
Author URI: http://www.ibuddypress.net
Network: true
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/*************************************************************************************************************
--- BuddyPress Wall 0.9.1 ---
*************************************************************************************************************/
// Define a constant that can be checked to see if the component is installed or not.
define( 'BP_WALL_IS_INSTALLED', 1 );
// Define a constant that will hold the current version number of the component
// This can be useful if you need to run update scripts or do compatibility checks in the future
define( 'BP_WALL_VERSION', '0.9.1' );
// Define a constant that we can use to construct file paths throughout the component
define( 'BP_WALL_PLUGIN_DIR', dirname( __FILE__ ) );
// Define a constant that we can use to construct the welcome page
define( 'BP_WALL_PLUGIN_FILE_LOADER', __FILE__ );
// Define a constant that we can use as plugin url
define( 'BP_WALL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define ( 'BP_WALL_DB_VERSION', '1.0' );
/* Only load the component if BuddyPress is loaded and initialized. */
function bp_wall_init() {
require( dirname( __FILE__ ) . '/includes/bp-wall-loader.php' );
}
add_action( 'bp_include', 'bp_wall_init' );
/* Put setup procedures to be run when the plugin is activated in the following function */
function bp_wall_activate() {
global $bp;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( !is_plugin_active( 'buddypress/bp-loader.php' ) ) {
//deactivate_plugins( basename( __FILE__ ) ); // Deactivate this plugin
die( _e( 'You cannot enable BuddyPress Wall <strong>BuddyPress</strong> is not active. Please install and activate BuddyPress before trying to activate Buddypress Wall.' , 'bp-wall' ) );
}
// Add the transient to redirect
set_transient( '_bp_wall_activation_redirect', true, 30 );
do_action( 'bp_wall_activation' );
}
register_activation_hook( __FILE__, 'bp_wall_activate' );
/* On deacativation, clean up anything your component has added. */
function bp_wall_deactivate() {
/* You might want to delete any options or tables that your component created. */
do_action( 'bp_wall_deactivation' );
}
register_deactivation_hook( __FILE__, 'bp_wall_deactivate' );
function bp_wall_template_filter_init() {
add_action( 'bp_template_content', 'bp_wall_filter_template_content' );
add_filter( 'bp_get_template_part', 'bp_wall_template_part_filter', 10, 3 );
}
add_action('bp_init', 'bp_wall_template_filter_init');
function bp_wall_template_part_filter( $templates, $slug, $name ) {
if ( 'activity/index' == $slug ) {
//return bp_buffer_template_part( 'activity/index-wall' );
$templates[0] = 'activity/index-wall.php';
}
elseif ( 'members/single/home' == $slug ) {
$templates[0] = 'members/single/home-wall.php';
//return bp_buffer_template_part( 'members/single/home-wall' );
}
elseif ( 'groups/single/home' == $slug ) {
$templates[0] = 'groups/single/home-wall.php';
//return bp_buffer_template_part( 'members/single/home-wall' );
}
return $templates;
//return bp_get_template_part( 'members/single/plugins' );
}
function bp_wall_filter_template_content() {
// bp_buffer_template_part( 'activity/index-wall' );
}