A WordPress-centric search engine for devs and theme authors



startelement ›

Since0.71
Deprecatedn/a
startelement ( $parser, $tagName, $attrs )
Access:
  • private
Parameters: (3)
  • (mixed) $parser XML Parser resource.
    Required: Yes
  • (string) $tagName XML element name.
    Required: Yes
  • (array) $attrs XML element attributes.
    Required: Yes
Defined at:
Codex:

XML callback function for the start of a new XML tag.



Source

function startElement( $parser, $tagName, $attrs ) {
	global $names, $urls, $targets, $descriptions, $feeds;

	if ( 'OUTLINE' === $tagName ) {
		$name = '';
		if ( isset( $attrs['TEXT'] ) ) {
			$name = $attrs['TEXT'];
		}
		if ( isset( $attrs['TITLE'] ) ) {
			$name = $attrs['TITLE'];
		}
		$url = '';
		if ( isset( $attrs['URL'] ) ) {
			$url = $attrs['URL'];
		}
		if ( isset( $attrs['HTMLURL'] ) ) {
			$url = $attrs['HTMLURL'];
		}

		// Save the data away.
		$names[]        = $name;
		$urls[]         = $url;
		$targets[]      = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : '';
		$feeds[]        = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : '';
		$descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : '';
	} // End if outline.
}