Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Jetpack_IXR_ClientMulticall example
private
static
function
get_jetpack_user
(
)
{
if
(
!
class_exists
(
'Jetpack'
)
)
return
false;
if
(
defined
(
'JETPACK__VERSION'
)
&&
version_compare
(
JETPACK__VERSION, '7.7', '<'
)
)
{
// For version of Jetpack prior to 7.7. Jetpack::
load_xml_rpc_client
(
)
;
}
$xml
=
new
Jetpack_IXR_ClientMulticall
(
array
(
'user_id' =>
get_current_user_id
(
)
)
)
;
$xml
->
addCall
(
'wpcom.getUserID'
)
;
$xml
->
addCall
(
'akismet.getAPIKey'
)
;
$xml
->
query
(
)
;
Akismet::
log
(
compact
(
'xml'
)
)
;
if
(
!
$xml
->
isError
(
)
)
{
$responses
=
$xml
->
getResponse
(
)
;
if
(
(
is_countable
(
$responses
)
?
count
(
$responses
)
: 0
)
> 1
)
{
// Due to a quirk in how Jetpack does multi-calls, the response order