Skip to content

Instantly share code, notes, and snippets.

@natebot
Last active December 22, 2015 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natebot/6417348 to your computer and use it in GitHub Desktop.
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.
<?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