wppaste
WordPress

MagpieRSS

Source
wp-includes/rss.php:34

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 17

$parserpublic
$current_itempublic
$itemspublic
$channelpublic
$textinputpublic
$imagepublic
$feed_typepublic
$feed_versionpublic
$stackpublic
$inchannelpublic
$initempublic
$incontentpublic
$intextinputpublic
$inimagepublic
$current_fieldpublic
$current_namespacepublic
$_CONTENT_CONSTRUCTSpublic

Methods · 13

Source code

class MagpieRSS {	var $parser;	var $current_item	= array();	// item currently being parsed	var $items			= array();	// collection of parsed items	var $channel		= array();	// hash of channel fields	var $textinput		= array();	var $image			= array();	var $feed_type;	var $feed_version; 	// parser variables	var $stack				= array(); // parser stack	var $inchannel			= false;	var $initem 			= false;	var $incontent			= false; // if in Atom <content mode="xml"> field	var $intextinput		= false;	var $inimage 			= false;	var $current_field		= '';	var $current_namespace	= false; 	//var $ERROR = ""; 	var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); 	/**	 * PHP5 constructor.	 */	function __construct( $source ) { 		# Check if PHP xml isn't compiled		#		if ( ! function_exists('xml_parser_create') ) {			wp_trigger_error( '', "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." );			return;		} 		$parser = xml_parser_create(); 		$this->parser = $parser; 		# pass in parser, and a reference to this object		# set up handlers		#		xml_set_element_handler($this->parser,				array( $this, 'feed_start_element' ), array( $this, 'feed_end_element' ) ); 		xml_set_character_data_handler( $this->parser, array( $this, 'feed_cdata' ) ); 		$status = xml_parse( $this->parser, $source ); 		if (! $status ) {			$errorcode = xml_get_error_code( $this->parser );			if ( $errorcode != XML_ERROR_NONE ) {				$xml_error = xml_error_string( $errorcode );				$error_line = xml_get_current_line_number($this->parser);				$error_col = xml_get_current_column_number($this->parser);				$errormsg = "$xml_error at line $error_line, column $error_col"; 				$this->error( $errormsg );			}		} 		if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0.			xml_parser_free( $this->parser );		} 		unset( $this->parser ); 		$this->normalize();	} 	/**	 * PHP4 constructor.	 */	public function MagpieRSS( $source ) {		self::__construct( $source );	} 	function feed_start_element($p, $element, &$attrs) {		$el = $element = strtolower($element);

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/rss.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.