public
|
#
__construct( string $xmlrpcEndPoint = null, string $username = null, string $password = null, Illuminate\Log\Writer $logger = null )
Create a new client
Parameters
- $xmlrpcEndPoint
- The wordpress XML-RPC endpoint (optional)
- $username
- The client's username (optional)
- $password
- The client's password (optional)
- $logger
- deprecated. This variable will not be used since 2.4.0
|
public
|
#
onError( Closure $callback )
Add a callback for error event
Add a callback for error event
Parameters
Since
2.4.0
|
public
|
#
onSending( Closure $callback )
Add a callback for sending event
Add a callback for sending event
Parameters
Since
2.4.0
|
public
|
#
setCredentials( string $xmlrpcEndPoint, string $username, string $password )
Set the endpoint, username and password for next requests
Set the endpoint, username and password for next requests
Parameters
- $xmlrpcEndPoint
- The wordpress XML-RPC endpoint
- $username
- The client's username
- $password
- The client's password
Since
2.4.0
|
public
string
|
#
getEndPoint( )
Get the current endpoint URL
Get the current endpoint URL
Returns
string
Since
2.4.2
|
public
string
|
#
getDefaultUserAgent( )
Get library default user agent
Get library default user agent
Returns
string
Since
2.4.0
|
public
string
|
#
getUserAgent( )
Get current user agent string
Get current user agent string
Returns
string
Since
2.4.0
|
public
|
#
setUserAgent( string $userAgent )
Set the user agent for next requests
Set the user agent for next requests
Parameters
- $userAgent
- custom user agent, give a falsy value to use library user agent
Since
2.4.0
|
public
string
|
#
getErrorMessage( )
Get the latest error message
Get the latest error message
Returns
string
Since
2.2
|
public
|
#
setProxy( boolean|array $proxyConfig )
Set the proxy config. To disable proxy, using
false
as parameter
Set the proxy config. To disable proxy, using
false
as parameter
Parameters
- $proxyConfig
The configuration array has these fields:
proxy_ip : the ip of the proxy server (WITHOUT port)
proxy_port : the port of the proxy server
proxy_user : the username for proxy authorization
proxy_pass : the password for proxy authorization
proxy_mode : value for CURLOPT_PROXYAUTH option (default to
CURLAUTH_BASIC)
Throws
InvalidArgumentException
Since
2.2
See
curl_setopt
|
public
boolean|array
|
#
getProxy( )
Get current proxy config
Returns
boolean|array
Since
2.2
|
public
|
#
setAuth( boolean|array $authConfig )
Set authentication info
Parameters
- $authConfig
the configuation array
auth_user : the username for server authentication
auth_pass : the password for server authentication
auth_mode : value for CURLOPT_HTTPAUTH option (default to
CURLAUTH_BASIC)
Throws
InvalidArgumentException
Since
2.2
See
curl_setopt
|
public
type
|
#
getAuth( )
Get the current HTTP authentication config
Get the current HTTP authentication config
Returns
type
Since
2.2
|
public
array
|
#
getPost( integer $postId, array $fields = array() )
Retrieve a post of any registered post type.
Retrieve a post of any registered post type.
Parameters
- $postId
- the id of selected post
- $fields
- (optional) list of field or meta-field names to include in response.
Returns
array
Link
|
public
array
|
#
getPosts( array $filters = array(), array $fields = array() )
Retrieve list of posts of any registered post type.
Retrieve list of posts of any registered post type.
Parameters
- $filters
- optional
- $fields
- optional
Returns
array array of struct
Link
|
public
integer
|
#
newPost( string $title, string $body, array $content = array(), integer $thumbnailId,…, array $content,… )
Create a new post of any registered post type.
Create a new post of any registered post type.
Parameters
- $title
- the post title
- $body
- the post body
- $content
- $categorieIds the list of category ids
- $thumbnailId,…
- the thumbnail id
- $content,…
- the content array, see more at wordpress documentation
Returns
integer the new post id
Link
|
public
boolean
|
#
editPost( integer $postId, array $content, string $body,…, array $categorieIds,…, integer $thumbnailId,…, array $content,… )
Edit an existing post of any registered post type.
Edit an existing post of any registered post type.
Parameters
- $postId
- the id of selected post
- $content
- $title the new title
- $body,…
- the new body
- $categorieIds,…
- the new list of category ids
- $thumbnailId,…
- the new thumbnail id
- $content,…
- the advanced array
Returns
boolean
Link
|
public
boolean
|
#
deletePost( integer $postId )
Delete an existing post of any registered post type.
Delete an existing post of any registered post type.
Parameters
- $postId
- the id of selected post
Returns
boolean
Link
|
public
array
|
#
getPostType( string $postTypeName, array $fields = array() )
Retrieve a registered post type.
Retrieve a registered post type.
Parameters
- $postTypeName
- the post type name
- $fields
- (optional) list of field or meta-field names to include in response.
Returns
array
Link
|
public
array
|
#
getPostTypes( array $filter = array(), array $fields = array() )
Retrieve list of registered post types.
Retrieve list of registered post types.
Parameters
Returns
array list of struct
Link
|
public
array
|
#
getPostFormats( )
Retrieve list of post formats.
Retrieve list of post formats.
Returns
array
Link
|
public
array
|
#
getPostStatusList( )
Retrieve list of supported values for post_status field on posts.
Retrieve list of supported values for post_status field on posts.
Returns
array list of supported post status
Link
|
public
array
|
#
getTaxonomy( string $taxonomy )
Retrieve information about a taxonomy.
Retrieve information about a taxonomy.
Parameters
- $taxonomy
- the name of the selected taxonomy
Returns
array taxonomy information
Link
|
public
array
|
#
getTaxonomies( )
Retrieve a list of taxonomies.
Retrieve a list of taxonomies.
Returns
array array of taxonomy struct
Link
|
public
array
|
#
getTerm( integer $termId, string $taxonomy )
Retrieve a taxonomy term.
Retrieve a taxonomy term.
Parameters
Returns
array
Link
|
public
array
|
#
getTerms( string $taxonomy, array $filter = array() )
Retrieve list of terms in a taxonomy.
Retrieve list of terms in a taxonomy.
Parameters
Returns
array
Link
|
public
integer
|
#
newTerm( string $name, string $taxomony, string $slug = null, string $description = null, integer $parentId = null )
Create a new taxonomy term.
Create a new taxonomy term.
Parameters
- $name
- $taxomony
- $slug
- $description
- $parentId
Returns
integer new term id
Link
|
public
boolean
|
#
editTerm( integer $termId, string $taxonomy, array $content = array() )
Edit an existing taxonomy term.
Edit an existing taxonomy term.
Parameters
- $termId
- $taxonomy
- $content
Returns
boolean
Link
|
public
boolean
|
#
deleteTerm( integer $termId, string $taxonomy )
Delete an existing taxonomy term.
Delete an existing taxonomy term.
Parameters
Returns
boolean
Link
|
public
array
|
#
getMediaItem( integer $itemId )
Retrieve a media item (i.e, attachment).
Retrieve a media item (i.e, attachment).
Parameters
Returns
array
Link
|
public
array
|
#
getMediaLibrary( array $filter = array() )
Retrieve list of media items.
Retrieve list of media items.
Parameters
Returns
array
Link
|
public
array
|
#
uploadFile( string $name, string $mime, string $bits, boolean $overwrite = null, integer $postId = null )
Upload a media file.
Parameters
- $name
- file name
- $mime
- file mime type
- $bits
- binary data (no encoded)
- $overwrite
- (optional)
- $postId
- (optional)
Returns
array
Link
|
public
array
|
#
getOptions( array $options = array() )
Retrieve blog options.
Parameters
Returns
array
Link
|
public
array
|
#
setOptions( array $options )
Edit blog options.
Parameters
Returns
array
Link
|
public
array
|
#
getUsersBlogs( )
Retrieve list of blogs for this user.
Retrieve list of blogs for this user.
Returns
array
Link
|
public
array
|
#
getUser( integer $userId, array $fields = array() )
Retrieve a user.
Parameters
- $userId
- $fields
- Optional. List of field or meta-field names to include in response.
Returns
array
Link
|
public
array
|
#
getUsers( array $filters = array(), array $fields = array() )
Retrieve list of users.
Parameters
Returns
array
Link
|
public
array
|
#
getProfile( array $fields = array() )
Retrieve profile of the requesting user.
Retrieve profile of the requesting user.
Parameters
Returns
array
Link
|
public
boolean
|
#
editProfile( array $content )
Edit profile of the requesting user.
Edit profile of the requesting user.
Parameters
Returns
boolean http://codex.wordpress.org/XML-RPC_WordPress_API/Users#wp.editProfile
|
public
mixed
|
#
callCustomMethod( string $method, array $params )
Call a custom XML-RPC method
Call a custom XML-RPC method
Parameters
- $method
- the method name
- $params
- the parameters of this call
Returns
mixed
Since
2.3.0
|
public
string
|
#
createXMLRPCDateTime( DateTime $datetime )
Create an XMLRPC DateTime object
Create an XMLRPC DateTime object
Parameters
Returns
string with the XMLRPC internal type is set to datetime
|
protected
|
|
protected
|
|