Last active
December 22, 2015 04:28
-
-
Save natebot/6417348 to your computer and use it in GitHub Desktop.
WordPress Co-Authors-Plus: template helpers for getting co-authors for feeds. You must specify the dublic core namespace in your xml document.
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 | |
function coauthors_feed() { | |
$authors = get_coauthors_feed(); // array of creator nodes, one for each author | |
echo wp_sprintf( '%l', $authors ); | |
} | |
// uses dublin core specification for creator, so please specify dc namespace. | |
function get_coauthors_feed(){ | |
$output = array(); | |
$authors = get_coauthors(); | |
foreach ( $authors as $author ) { | |
$output[] = sprintf( '<dc:creator><![CDATA[%s]]></dc:creator>', $author); | |
} | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment