forked from boonebgorges/bp-group-reviews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.php
46 lines (34 loc) · 1.31 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
<?php
/*
Plugin Name: BP Group Reviews
Author: boonebgorges
Author URL: http://boonebgorges.com
Description: Adds a review/rating section to BuddyPress groups. As seen on buddypress.org/extend/plugins
Version: 1.2.3
*/
define( 'BP_GROUP_REVIEWS_VERSION', '1.2.3' );
if ( !defined( 'BP_GROUP_REVIEWS_SLUG' ) )
define( 'BP_GROUP_REVIEWS_SLUG', 'reviews' );
if ( !defined( 'BP_GROUP_REVIEWS_DIR' ) )
define( 'BP_GROUP_REVIEWS_DIR', WP_PLUGIN_DIR . '/bp-group-reviews/' );
if ( !defined( 'BP_GROUP_REVIEWS_URL' ) )
define( 'BP_GROUP_REVIEWS_URL', WP_PLUGIN_URL . '/bp-group-reviews/' );
function bpgr_loader() {
require_once( dirname(__FILE__) . '/bp-group-reviews.php' );
}
add_action( 'bp_include', 'bpgr_loader' );
function bpgr_textdomain() {
$locale = get_locale();
// First look in wp-content/languages, where custom language files will not be overwritten by upgrades. Then check the packaged language file directory.
$mofile_custom = WP_CONTENT_DIR . "/languages/bpgr-$locale.mo";
$mofile_packaged = BP_GROUP_REVIEWS_DIR . "languages/bpgr-$locale.mo";
if ( file_exists( $mofile_custom ) ) {
load_textdomain( 'bpgr', $mofile_custom );
return;
} else if ( file_exists( $mofile_packaged ) ) {
load_textdomain( 'bpgr', $mofile_packaged );
return;
}
}
add_action ( 'plugins_loaded', 'bpgr_textdomain' );
?>