wppaste
WordPress

IXR_Server

Since
1.5.0
Source
wp-includes/IXR/class-IXR-server.php:9
IXR_Server

Compatibility

WordPress
since 1.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 4

$datapublic
$callbackspublic
$messagepublic
$capabilitiespublic

Methods · 12

Source code

class IXR_Server{    var $data;    var $callbacks = array();    var $message;    var $capabilities; 	/**	 * PHP5 constructor.	 */    function __construct( $callbacks = false, $data = false, $wait = false )    {        $this->setCapabilities();        if ($callbacks) {            $this->callbacks = $callbacks;        }        $this->setCallbacks();        if (!$wait) {            $this->serve($data);        }    } 	/**	 * PHP4 constructor.	 */	public function IXR_Server( $callbacks = false, $data = false, $wait = false ) {		self::__construct( $callbacks, $data, $wait );	}     function serve($data = false)    {        if (!$data) {            if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {                if ( function_exists( 'status_header' ) ) {                    status_header( 405 ); // WP #20986                    header( 'Allow: POST' );                }                header('Content-Type: text/plain'); // merged from WP #9093                die('XML-RPC server accepts POST requests only.');            }             $data = file_get_contents('php://input');        }        $this->message = new IXR_Message($data);        if (!$this->message->parse()) {            $this->error(-32700, 'parse error. not well formed');        }        if ($this->message->messageType != 'methodCall') {            $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');        }        $result = $this->call($this->message->methodName, $this->message->params);         // Is the result an error?        if (is_a($result, 'IXR_Error')) {            $this->error($result);        }         // Encode the result        $r = new IXR_Value($result);        $resultxml = $r->getXml();         // Create the XML        $xml = <<<EOD<methodResponse>  <params>    <param>      <value>      $resultxml      </value>    </param>  </params></methodResponse> EOD;      // Send it      $this->output($xml);    }     function call($methodname, $args)    {

Changelog

Introduced in 1.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/IXR/class-IXR-server.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.