AtomParser::map_xmlns() WordPress Method

The AtomParser::map_xmlns() method in Wordpress allows developers to map XML namespaces to their own prefixes. This is useful when working with XML documents that have multiple namespaces defined. By mapping the namespaces to their own prefixes, developers can access the data in the XML document more easily.

AtomParser::map_xmlns( indexish $p, array $n ) #

Map XML namespace to string.


Parameters

$p

(indexish)(Required)XML Namespace element index

$n

(array)(Required)Two-element array pair. [ 0 => {namespace}, 1 => {url} ]


Top ↑

Return

(string) 'xmlns="{url}"' or 'xmlns:{namespace}="{url}"'


Top ↑

Source

File: wp-includes/atomlib.php

	public static function map_xmlns($p, $n) {
		$xd = "xmlns";
		if( 0 < strlen($n[0]) ) {
			$xd .= ":{$n[0]}";
		}
		return "{$xd}=\"{$n[1]}\"";
	}

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.