@ronaldb73 Sorry for misunderstanding. I have a solution.
The output of rss2
is located at wp-includes/feed-rss2.php
. There is no filter to hide the <dc:creator>
tag (this is author tag).
But that file is included from do_feed_rss2()
function which hooked to do_feed_rss2
action, so you can add your own do_feed_rss2 function to include your custom feed output file.
Step 1: Copy file wp-includes/feed-rss2.php
to your plugin, then remove <dc:creator>
.
Step 2: Add the code below to your plugin, remember to change the file path:
remove_action( 'do_feed_rss2', 'do_feed_rss2', 10 );
function prefix_do_feed_rss2( $for_comments ) {
var_dump($for_comments);
if ( $for_comments )
load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' );
else
load_template( plugin_dir_path( __FILE__ ) . 'feed-rss2.php' ); // Change to your own file path.
}
add_action( 'do_feed_rss2', 'prefix_do_feed_rss2' );
Step 3: Check the rss output. Use Ctrl + F5 if it doesn’t work.