Title: IXR_Message::tag_close
Published: July 6, 2022
Last modified: May 20, 2026

---

# IXR_Message::tag_close( $parser,  $tag )

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/ixr_message/tag_close/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/ixr_message/tag_close/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/ixr_message/tag_close/?output_format=md#wp--skip-link--target)

## 󠀁[Source](https://developer.wordpress.org/reference/classes/ixr_message/tag_close/?output_format=md#source)󠁿

    ```php
    function tag_close($parser, $tag)
    {
        $valueFlag = false;
        switch($tag) {
            case 'int':
            case 'i4':
                $value = (int)trim($this->_currentTagContents);
                $valueFlag = true;
                break;
            case 'double':
                $value = (float)trim($this->_currentTagContents);
                $valueFlag = true;
                break;
            case 'string':
                $value = (string)trim($this->_currentTagContents);
                $valueFlag = true;
                break;
            case 'dateTime.iso8601':
                $value = new IXR_Date(trim($this->_currentTagContents));
                $valueFlag = true;
                break;
            case 'value':
                // "If no type is indicated, the type is string."
                if (trim($this->_currentTagContents) != '') {
                    $value = (string)$this->_currentTagContents;
                    $valueFlag = true;
                }
                break;
            case 'boolean':
                $value = (bool)trim($this->_currentTagContents);
                $valueFlag = true;
                break;
            case 'base64':
                $value = base64_decode($this->_currentTagContents);
                $valueFlag = true;
                break;
                /* Deal with stacks of arrays and structs */
            case 'data':
            case 'struct':
                $value = array_pop($this->_arraystructs);
                array_pop($this->_arraystructstypes);
                $valueFlag = true;
                break;
            case 'member':
                array_pop($this->_currentStructName);
                break;
            case 'name':
                $this->_currentStructName[] = trim($this->_currentTagContents);
                break;
            case 'methodName':
                $this->methodName = trim($this->_currentTagContents);
                break;
        }

        if ($valueFlag) {
            if (count($this->_arraystructs) > 0) {
                // Add value to struct or array
                if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
                    // Add to struct
                    $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
                } else {
                    // Add to array
                    $this->_arraystructs[count($this->_arraystructs)-1][] = $value;
                }
            } else {
                // Just add as a parameter
                $this->params[] = $value;
            }
        }
        $this->_currentTagContents = '';
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ixr/class-ixr-message.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/IXR/class-IXR-message.php#L176)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/IXR/class-IXR-message.php#L176-L246)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/ixr_message/tag_close/?output_format=md#related)󠁿

| Uses | Description | 
| [IXR_Date::__construct()](https://developer.wordpress.org/reference/classes/ixr_date/__construct/)`wp-includes/IXR/class-IXR-date.php` |

PHP5 constructor.

  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fixr_message%2Ftag_close%2F)
before being able to contribute a note or feedback.