Starts a new XML tag.
Description
Callback function for xml_set_element_handler().
Parameters
$parser
resourcerequired- XML Parser resource.
$tag_name
stringrequired- XML element name.
$attrs
arrayrequired- XML element attributes.
Source
function startElement( $parser, $tag_name, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
global $names, $urls, $targets, $descriptions, $feeds;
if ( 'OUTLINE' === $tag_name ) {
$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.
}
Changelog
Version | Description |
---|---|
0.71 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.