$method_name, 'params' => $args, ); $this->calls[] = $struct; } /** * Perform the IXR multicall request. * * @return bool True if request succeeded, false otherwise. */ public function query() { usort( $this->calls, array( $this, 'sort_calls' ) ); // Prepare multicall, then call the parent::query() method. return parent::query( 'system.multicall', $this->calls ); } /** * Sort the IXR calls. * Make sure syncs are always done first. * * @param array $a First call in the sorting iteration. * @param array $b Second call in the sorting iteration. * @return int Result of the sorting iteration. */ public function sort_calls( $a, $b ) { if ( 'jetpack.syncContent' === $a['methodName'] ) { return -1; } if ( 'jetpack.syncContent' === $b['methodName'] ) { return 1; } return 0; } }