wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_oembed_create_xml is private and should not be used in themes or plugins directly.
_oembed_create_xml › WordPress Function
Seit4.4.0
Veraltetn/v
› _oembed_create_xml ( $data, $node = null )
| Zugriff: |
|
| Parameter: (2) |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Creates an XML string from a given array.
Ähnliche Funktionen: maybe_create_table, wp_oembed_get, wp_oembed_register_route, get_embed_template, the_date_xml
Quellcode
function _oembed_create_xml( $data, $node = null ) {
if ( ! is_array( $data ) || empty( $data ) ) {
return false;
}
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();
}