startElement
XML callback function for the start of a new XML tag.
Description
Parameters (3)
- 0. $parser (mixed)
- XML Parser resource.
- 1. $tagname (string)
- XML element name.
- 2. $attrs (array)
- XML element attributes.
Usage
if ( !function_exists( 'startElement' ) ) { require_once ABSPATH . '/wp-admin/link-parse-opml.php'; } // XML Parser resource. $parser = null; // XML element name. $tagname = ''; // XML element attributes. $attrs = array(); // NOTICE! Understand what this does before running. $result = startElement($parser, $tagname, $attrs);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/link-parse-opml.php
- 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.
- }