forked from eduardoweiland/buddypress-xmlrpc-receiver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bp-xmlrpc-loader.php
68 lines (54 loc) · 1.91 KB
/
bp-xmlrpc-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
<?php
/*
Plugin Name: BuddyPress XMLRPC Receiver
Plugin URI: http://github.com/duduweiland/buddypress-xmlrpc-receiver/
Description: Allow remote connection via XML-RPC for BuddyPress
Author: Eduardo Weiland
Author URI: http://eduardoweiland.tk
License: GNU General Public License v3 http://www.gnu.org/licenses/gpl.txt
Version: 0.1.1
Text Domain: bp-xmlrpc
Network: true
*/
if ( !defined( 'BP_XMLRPC_URL' ) )
define( 'BP_XMLRPC_URL', WP_PLUGIN_URL .'/'. basename( dirname( __FILE__ ) ) .'/bp-xmlrpc.php' );
/**
* Load code that needs BuddyPress to run once BP is loaded and initialized.
*
* @return void
*/
function bp_xmlrpc_init() {
require_once( dirname( __FILE__ ) . '/includes/bp-xmlrpc-functions.php' );
require_once( dirname( __FILE__ ) . '/includes/bp-xmlrpc-profile.php' );
}
add_action( 'bp_core_loaded', 'bp_xmlrpc_init' );
/**
* Load translation files.
*
* @return void
*/
function bp_xmlrpc_load_translation() {
load_plugin_textdomain( 'bp-xmlrpc', false, basename( dirname( __FILE__ ) ) .'/languages/' );
}
add_action( 'plugins_loaded', 'bp_xmlrpc_load_translation' );
/**
* Adds the options page under "Settings" menu for site administrators.
*
* @return void
*/
function bp_xmlrpc_admin_add_admin_menu() {
global $bp;
if ( !is_super_admin() )
return false;
// Add the component's administration tab under the "Settings" menu for site administrators
require ( dirname( __FILE__ ) . '/admin/bp-xmlrpc-admin.php' );
add_options_page( __( 'BuddyPress XML-RPC', 'bp-xmlrpc' ),
__( 'BuddyPress XML-RPC', 'bp-xmlrpc' ),
'manage_options',
'bp-xmlrpc-settings',
'bp_xmlrpc_admin' );
// set up defaults
add_option( 'bp_xmlrpc_cap_low', 'upload_files' ); // author
}
add_action( 'admin_menu', 'bp_xmlrpc_admin_add_admin_menu' );
?>