-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-client.php
45 lines (37 loc) · 1.38 KB
/
example-client.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
<?php
/*
Plugin Name: bbBolt Example Clients
Description: This plugin registers two example clients for your tire-kicking pleasure. The bbBolt Servers are located at <a href="http://demo.bbbolt.org">demo.bbbolt.org</a> and <a href="http://bbbolt.brentshepherd.com">bbbolt.brentshepherd.com</a>.
Author: Brent Shepherd
Author URI: http://find.brentshepherd.com/
Version: beta-1
*/
/**
* Imagine this as a whiz-bang plugin that wants to offer premium support via a bbBolt server.
*
* We first need the bbBolt Client Class.
*/
require_once( 'bbbolt-client.class.php' );
/**
* Now we can create our client.
* As the parameters explain, this client is called 'bbBolt Demo' and uses the bbBolt Server
* active at demo.bbbolt.org.
*/
function eg_register_client(){
if( function_exists( 'register_bbbolt_client' ) ){
$args = array( 'site_url' => 'http://demo.bbbolt.org/' );
register_bbbolt_client( 'bbBolt Demo', $args );
}
}
add_action( 'init', 'eg_register_client' );
/**
* Another example for registering a bbBolt Client just so the UI shows what life is like with
* multiple clients active on the one site.
*/
function ep_register_another_client(){
if( function_exists( 'register_bbbolt_client' ) ){
$args = array( 'site_url' => 'http://bbbolt.brentshepherd.com/' );
register_bbbolt_client( "Brent's bbBolt Server", $args );
}
}
add_action( 'init', 'ep_register_another_client' );