_oembed_create_xml

Advertisement

Private Access Private Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Summery Summery

Creates an XML string from a given array.

Syntax Syntax

_oembed_create_xml( array $data, SimpleXMLElement $node = null )

Parameters Parameters

$data

(array) (Required) The original oEmbed response data.

$node

(SimpleXMLElement) (Optional) XML node to append the result to recursively.

Default value: null

Return Return

(string|false) XML string on success, false on error.

Source Source

File: wp-includes/embed.php

	}

	if ( null === $node ) {
		$node = new SimpleXMLElement( '<oembed></oembed>' );
	}

	foreach ( $data as $key => $value ) {
		if ( is_numeric( $key ) ) {
			$key = 'oembed';
		}

		if ( is_array( $value ) ) {
			$item = $node->addChild( $key );
			_oembed_create_xml( $value, $item );
		} else {
			$node->addChild( $key, esc_html( $value ) );
		}
	}

	return $node->asXML();
}

/**
 * Filters the given oEmbed HTML to make sure iframes have a title attribute.

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.