Last active
February 3, 2020 11:09
-
-
Save goodevilgenius/9786001 to your computer and use it in GitHub Desktop.
[WP atom:updated] Wordpress Plugin to add atom:updated to rss feed #Wordpress #RSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @version 0.1 | |
*/ | |
/* | |
Plugin Name: Atom:Updated | |
Plugin URI: https://gist.github.com/goodevilgenius/9786001 | |
Description: This plugin adds atom:updated to your RSS2 feed | |
Author: Dan Jones | |
Version: 0.1 | |
Author URI: http://danielrayjones.com/ | |
*/ | |
function atom_updated() { | |
echo "<atom:updated>"; | |
echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); | |
echo "</atom:updated>\n"; | |
} | |
add_action( 'rss2_item', 'atom_updated' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this!