Summery Summery

Send the content-type header with correct encoding

Syntax Syntax

SimplePie::handle_content_type( string $mime = 'text/html' )

Description Description

This method ensures that the SimplePie-enabled page is being served with the correct mime-type and character encoding HTTP headers (character encoding determined by the set_output_encoding config option).

This won’t work properly if any content or whitespace has already been sent to the browser, because it relies on PHP’s header() function, and these are the circumstances under which the function works.

Because it’s setting these settings for the entire page (as is the nature of HTTP headers), this should only be used once per page (again, at the top).

Parameters Parameters


(string) (Optional) MIME type to serve the page as

Default value: 'text/html'

Source Source

File: wp-includes/class-simplepie.php

					$this->raw_data = false;
					return true;
			// If the cache is empty, delete it
				$this->data = array();
		// If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.
		if (!isset($file))
			if ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url)



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.