IXR_Value::__construct() WordPress Method

The IXR_Value::__construct() method is used to create an IXR_Value object. This object can then be used to represent a value in an XML-RPC message.

IXR_Value::__construct( $data,  $type = false ) #

PHP5 constructor.


Source

File: wp-includes/IXR/class-IXR-value.php

	function __construct( $data, $type = false )
    {
        $this->data = $data;
        if (!$type) {
            $type = $this->calculateType();
        }
        $this->type = $type;
        if ($type == 'struct') {
            // Turn all the values in the array in to new IXR_Value objects
            foreach ($this->data as $key => $value) {
                $this->data[$key] = new IXR_Value($value);
            }
        }
        if ($type == 'array') {
            for ($i = 0, $j = count($this->data); $i < $j; $i++) {
                $this->data[$i] = new IXR_Value($this->data[$i]);
            }
        }
    }

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.