Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Feed Element Filter
- Plugin URI:
- Description: filters some of the Feed elements
- Author:
- Version: 1.0
- Author URI:
- */
- add_filter('bloginfo_rss', 'pff_modify_bloginfo', 10, 2);
- function pff_modify_bloginfo($content, $feedelementname) {
- // This filter can filter the Feed title, the URL and the description
- Switch ($feedelementname) {
- case 'name' : // Feed title
- // If it is the feed with the slug 'podcast' replace the title as long as this plugin is active.
- // ( get_query_var('feed') can also be'feed' (RSS2), 'atom' (ATOM))
- if ( 'podcast' === get_query_var('feed') ) {
- // The new Feed title:
- return 'My Podcast';
- } else {
- return $content;
- }
- break;
- case 'description' : // Feed description
- return $content;
- break;
- case 'url' : // Feed URL
- return $content;
- break;
- default :
- return $content;
- break;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement