Filter hook 'feed_content_type'

in WP Core File wp-includes/feed.php at line 787

View Source

feed_content_type

Filter Hook
Description
Filters the content type for a specific feed type.

Hook Information

File Location wp-includes/feed.php View on GitHub
Hook Type Filter
Line Number 787

Hook Parameters

Type Name Description
string $content_type Content type indicating the type of data that a feed contains.
string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.

Usage Examples

Basic Usage
<?php
// Hook into feed_content_type
add_filter('feed_content_type', 'my_custom_filter', 10, 2);

function my_custom_filter($content_type, $type) {
    // Your custom filtering logic here
    return $content_type;
}

Source Code Context

wp-includes/feed.php:787 - How this hook is used in WordPress core
<?php
 782  	 * @since 2.8.0
 783  	 *
 784  	 * @param string $content_type Content type indicating the type of data that a feed contains.
 785  	 * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 786  	 */
 787  	return apply_filters( 'feed_content_type', $content_type, $type );
 788  }
 789  
 790  /**
 791   * Builds SimplePie object based on RSS or Atom feed from URL.
 792   *

PHP Documentation

<?php
/**
	 * Filters the content type for a specific feed type.
	 *
	 * @since 2.8.0
	 *
	 * @param string $content_type Content type indicating the type of data that a feed contains.
	 * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/feed.php
Related Hooks

Related hooks will be displayed here in future updates.