Allows multiple authors to be assigned to a post. Co-authored posts appear on a co-author's posts page and feed. New template tags list co-author
Notice: This plugin is not being actively maintained. Other priorities have arisen which have forced development to discontinue. Being open source and free, you are of course free to take the code and improve upon it; if you are a developer and would like to be added as a commiter to this plugin, please contact me.
Allows multiple authors to be associated with a post. Co-authored posts appear on a co-author's posts page and feed. Additionally, co-authors may edit the posts they are associated with, and co-authors who are contributors may only edit posts if they have not been published (as is usual). Editors may easily add co-authors via the 'Post Author(s)' or 'Page Author(s)' boxes on the post/page writing page (see screenshots). New template tags enable listing of co-authors:
coauthors()coauthors_posts_links()coauthors_firstnames()coauthors_lastnames()coauthors_nicknames()coauthors_links()coauthors_IDs()These template tags correspond to their "the_author*" equivalents; take special note of the pluralization.
Each of these template tags accept four optional arguments:
between: default ", "betweenLast: default " and "before: default ""after: default ""To use them, simply modify the code surrounding all instances of the_author*() to something like as follows:
if(function_exists('coauthors_posts_links'))
coauthors_posts_links();
else
the_author_posts_link();
The result of this would be formatted like "John Smith, Jane Doe and Joe Public".
Note that as of this writing, WordPress does provide a means of extending wp_list_authors(), so
included in this plugin is the function coauthors_wp_list_authors() modified
to take into account co-authored posts; the same arguments are accepted.
Sometimes you may need fine-graned control over the display of a posts's authors, and in this case you may use
the CoAuthorsIterator class. This class may be instantiated anywhere you may place the_author()
or everywhere if the post ID is provided to the constructor. The instantiated class has the following methods:
iterate(): advances $authordata to the next co-author; returns false and restores the original $authordata if there are no more authors to iterate. get_position(): returns the zero-based index of the current author; returns -1 if the iterator is invalidis_last(): returns true if the current author is the lastis_first(): returns true if the current author is the firstcount(): returns the total number of authorsget_all(): returns an array of all of the authors' user dataFor example:
$i = new CoAuthorsIterator();
print $i->count() == 1 ? 'Author: ' : 'Authors: ';
$i->iterate();
the_author();
while($i->iterate()){
print $i->is_last() ? ' and ' : ', ';
the_author();
}
When a user is deleted from WordPress, they will be removed from all of posts for which they are co-authors, and if a replacement user is provided, their co-authored posts will instead be co-attributed to another user.
Inspired by 'Multiple Authors' plugin by Mark Jaquith (2005).
If you value this plugin, please donate to ensure that it may continue to be maintained and improved.
2009-07-02: 1.0 (beta 6)
2008-09-29: 1.0 (beta 5)
2008-09-29: 1.0 (beta 4)
_coauthor post meta to a selected replacement user. This was causing big problems in 2.6 (probably related to post revision functionality).2008-09-29: 1.0 (beta 3)
2008-06-16: 1.0 (beta 2)
2008-06-16: 1.0 (beta)
2008-06-15: 0.8.3
2008-01-06: 0.8.2
2008-01-06: 0.8.1
2007-12-30: 0.8