addCall 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                 // can't be trusted to match the call order. It's a good thing our                 // return values can be mostly differentiated from each other.
Home | Imprint | This part of the site doesn't use cookies.