| since |
1.0 |
| package |
bbPress |
| subpackage |
Publishing |
| uses |
IXR_Server |
| inherited_from |
\IXR_Server |
Methods
BB_XMLRPC_Server()
BB_XMLRPC_Server()
IXR_Server()
IXR_Server($callbacks = false, $data = false, $wait = false)
Inherited
Parameters
$callbacks
$data
$wait
Initialises the XML-RPC server
__construct() : void
| since |
1.0 |
| inherited_from |
\IXR_Server::__construct() |
__construct()
__construct($callbacks = false, $data = false, $wait = false)
Inherited
Parameters
$callbacks
$data
$wait
Compiles site options into an array suitable to be passed back through the XML-RPC server
_getOptions(array $options) : array
Parameters
$options
arrayAn array of options to fetch and return
Returns
arrayThe site options in an array
Adds two numbers together as a demo of XML-RPC
addTwoNumbers(array $args) : integer
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerThe sum of the two supplied numbers
Checks the user credentials supplied in the request to make sure they are valid
authenticate(string $user_login, string $user_pass, string $capability = 'read', string $message = false) : integer | boolean
Parameters
$user_login
stringThe users login
$user_pass
stringThe users password in plain text
$capability
stringThe capability to check (optional)
$message
stringThe message to pass back in the error if the capability check fails (optional)
Returns
integerbooleanThe user id if the user is valid, otherwise false
Closes a topic
bb_closeTopic(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject0 when already changed, 1 when successfully changed or an IXR_Error object on failure
Deletes a forum
bb_deleteForum(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject1 when successfully deleted or an IXR_Error object on failure
Deletes an existing post
bb_deletePost(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject1 when successfully deleted, 0 when already deleted or an IXR_Error object on failure
Deletes a topic
bb_deleteTopic(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject0 if already changed, 1 when successfully changed or an IXR_Error object on failure
Destroys the specified tag
bb_destroyTopicTag(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject1 when successfully deleted or an IXR_Error object on failure
Edits an existing forum
bb_editForum(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe forum data when successfully edited or an IXR_Error object on failure
Edits an existing post
bb_editPost(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe post data when successfully edited or an IXR_Error object on failure
Edits an existing topic
bb_editTopic(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe topic data when successfully edited or an IXR_Error object on failure
Returns details of a forum
bb_getForum($args) : array | object
Parameters
$args
Returns
arrayobjectAn array containing details of the returned forum when successfully executed or an IXR_Error object on failure
Returns a numerical count of forums
bb_getForumCount(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectThe number of forums when successfully executed or an IXR_Error object on failure
Returns details of multiple forums
bb_getForums(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectAn array containing details of all returned forums when successfully executed or an IXR_Error object on failure
Gets the specified site options
bb_getOptions(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectAn array containing the specified options when successfully executed or an IXR_Error object on failure
Returns details of a post
bb_getPost(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectAn array containing details of the returned post when successfully executed or an IXR_Error object on failure
Returns a numerical count of posts
bb_getPostCount(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectThe number of topics when successfully executed or an IXR_Error object on failure
Returns details of the posts in a given topic
bb_getPosts(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe posts when successfully executed or an IXR_Error object on failure
Returns details of a topic
bb_getTopic($args) : array | object
Parameters
$args
Returns
arrayobjectAn array containing details of the returned topic when successfully executed or an IXR_Error object on failure
Returns a numerical count of topics
bb_getTopicCount(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectThe number of topics when successfully executed or an IXR_Error object on failure
Returns the topics which are tagged with the given tag
bb_getTopicTag(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectThe topic data when successfully executed or an IXR_Error object on failure
Returns a numerical count of tags in a given topic or all tags
bb_getTopicTagCount(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectThe number of topics when successfully executed or an IXR_Error object on failure
Returns details of the latest topics
bb_getTopics(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe topics when successfully executed or an IXR_Error object on failure
Moves a topic to a different forum
bb_moveTopic(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobjectthe forum id where the topic lives after the method is called or an IXR_Error object on failure
Creates a new forum
bb_newForum(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe forum data when successfully created or an IXR_Error object on failure
Creates a new post in a given topic
bb_newPost(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe post data when successfully created or an IXR_Error object on failure
Creates a new topic
bb_newTopic(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe topic data when successfully created or an IXR_Error object on failure
Renames the specified tag to a new tag name
bb_renameTopicTag(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectThe tag data when successfully renamed or an IXR_Error object on failure
Sets the specified site options to the specified values
bb_setOptions(array $args) : array | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayobjectAn array containing the specified options when successfully executed or an IXR_Error object on failure
Sticks a topic to the top of a forum or the front page
bb_stickTopic(array $args) : integer | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
integerobject0 if it is already stuck to the desired location, 1 when successfully stuck or an IXR_Error object on failure
call()
call($methodname, $args)
Inherited
Parameters
$methodname
$args
error()
error($error, $message = false)
Inherited
Parameters
$error
$message
Sanitises data from XML-RPC request parameters
escape($array) : mixed
Parameters
$array
mixed The variable to be sanitised
Returns
mixedThe sanitised variable, should come back with the same type
getCapabilities()
getCapabilities($args)
Inherited
hasMethod()
hasMethod($method)
Inherited
Initialises site options which can be manipulated using XML-RPC
initialise_site_option_info() : void
listMethods()
listMethods($args)
Inherited
multiCall()
multiCall($methodcalls)
Inherited
output()
output($xml)
Inherited
Returns an array of URLs that pingbacked the given URL
pingback_extensions_getPingbacks(array $args) : array
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
arrayThe array of URLs that pingbacked the given topic
Processes pingback requests
pingback_ping(array $args) : string | object
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
stringobjectA message of success or an IXR_Error object on failure
Prepares forum data for return in an XML-RPC object
prepare_forum(array | object $forum) : array
Parameters
$forum
arrayobjectThe unprepared forum data
Returns
arrayThe prepared forum data
Prepares post data for return in an XML-RPC object
prepare_post(array | object $post) : array
Parameters
$post
arrayobjectThe unprepared post data
Returns
arrayThe prepared post data
Prepares topic data for return in an XML-RPC object
prepare_topic(array | object $topic) : array
Parameters
$topic
arrayobjectThe unprepared topic data
Returns
arrayThe prepared topic data
Prepares topic tag data for return in an XML-RPC object
prepare_topic_tag(array | object $tag) : array
Parameters
$tag
arrayobjectThe unprepared topic tag data
Returns
arrayThe prepared topic tag data
Hello world demo function for XML-RPC
sayHello(array $args) : string
Parameters
$args
arrayArguments passed by the XML-RPC call
Returns
stringThe phrase 'Hello!'
serve()
serve($data = false)
Inherited
setCallbacks()
setCallbacks()
Inherited
setCapabilities()
setCapabilities()
Inherited
Switches the currently active user for incognito actions
switch_user(string $user_login, string $capability = 'read', string $message = false) : integer | boolean
Parameters
$user_login
stringThe users login
$capability
stringThe capability to check (optional)
$message
stringThe message to pass back in the error if the capability check fails (optional)
Returns
integerbooleanThe user id if the user is valid, otherwise false
Properties
Whether user switching is allowed
$allow_user_switching : boolean
Whether read-only methods require authentication
$auth_readonly : boolean
$capabilities
$capabilities
Stores the last error generated by the class
$error : object | boolean
Site options which can be manipulated using XML-RPC
$site_options : array