=== Co-Authors Plus ===
Contributors: batmoo
Donate link: http://digitalize.ca/donate
Tags: authors, users
Tested up to: 2.7.1
Requires at least: 2.6
Stable tag: 1.1.5
Allows multiple authors to be assigned to a Post or Page via search-as-you-type input boxes.
== Description ==
> **IMPORTANT: If you are upgrading from 1.1.3, please delete the plugin from your plugins directory and reinstall!**
Allows multiple authors to be assigned to a Post or Page via the search-as-you-type inputs. Co-authored posts appear on a co-author's posts page and feed. New template tags allow listing of co-authors. Editors and Administrators may assign co-authors to a post. 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).
This plugin is an extended version of the Co-Authors plugin originally developed at [Shepherd Interactive](http://www.shepherd-interactive.com/ "Shepherd Interactive specializes in web design and development in Portland, Oregon") (2007). Their plugin was inspired by 'Multiple Authors' plugin by Mark Jaquith (2005).
The extended version is created by Mohammad Jangda, and incorporates search-as-you-type functionality for adding users, which aims to make easy the task of adding multiple users to posts and pages, especially when dealing with a system with hundreds of users (typical of newspaper and magazine sites).
> *See "Other Notes" section for Template Tags and usage information
= Changelog =
*2009-04-26 / 1.1.5*
* Bug fix: Not searching Updated SQL query for autosuggest to search through first name, last name, and nickname
* Bug fix: When editing an author, and clicking on a suggested author, the original author was not be removed
* Docs: Added code comments to javascript; more still to be added
* Docs: Updated readme information
*2009-04-25 / 1.1.4*
* Disabled "New Author" output in suggest box, for now
* Hopefully fixed SVN issue (if you're having trouble with the plugin, please delete the plugin and reinstall)
*2009-04-23 / 1.1.3*
* Add blur event to disable input box
* Limit only one edit at a time.
* Checked basic cross-browser compatibility (Firefox 3 OS X, Safari 3 OS X, IE7 Vista).
* Add suggest javascript plugin to Edit Page.
*2009-04-19 / 1.1.2*
* Disabled form submit when enter pressed.
*2009-04-15 / 1.1.1*
* Changed SQL query to return only contributer-level and above users.
*2009-04-14: 1.1.0*
* Initial beta release.
== Installation ==
1. IMPORTANT: Please disable the original Co-Authors plugin (if you are using it) before installing Co-Authors Plus
1. Extract the coauthors-plus.zip file and upload its contents to the `/wp-content/plugins/` directory. Alternatively you can install directly from the Plugin directory within your WordPress Install.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Place the appropriate coauthors template tags in your template.
1. Add co-authors to your posts and pages.
== Basic Usage and Other Notes ==
*Only Author-level and above can be added as co-authors. Namely, contributers cannot be added as co-authors.
*As per WordPress design, only Editor-level and above users can change Post Authors. Authors cannot change authors or add co-authors (yet)
*As per WordPress design, when an editor creates a new Post or Page, they are by default added as an author. However, they can changed by clicking on their name and typing in the name of the new author.
*The search-as-you-type box starts searching once two letters have been added, and executes a new search with every subsequent letter.
*The search-as-you-type box searches through the following user fields: a) user_login; b) user_nicename; c) display_name; d) user_email; e) first_name; f) last_name; and g) nickname.
== Template Tags ==
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:
1. between: default ", "
1. betweenLast: default " and "
1. before: default ""
1. 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:
1. iterate(): advances $authordata to the next co-author; returns false and restores the original $authordata if there are no more authors to iterate.
1. get_position(): returns the zero-based index of the current author; returns -1 if the iterator is invalid
1. is_last(): returns true if the current author is the last
1. is_first(): returns true if the current author is the first
1. count(): returns the total number of authors
1. get_all(): returns an array of all of the authors' user data
For example:
$i = new CoAuthorsIterator();
print $i->count() == 1 ? 'Author: ' : 'Authors: ';
$i->iterate();
the_author();
while($i->iterate()){
print $i->is_last() ? ' and ' : ', ';
the_author();
}
== Frequently Asked Questions ==
= WhatÕs the main difference between Co-Authors and Co-Authors Plus? =
The most notable difference is the replacement of the standard WordPress authors drop-downs with search-as-you-type/auto-suggest/whatever-you-call-them input boxes. As a result, major bits of the JavaScript code was changed to be more jQuery-friendly. Eventually, I hope to include the ability to add new Users from within the Edit Post/Page screen and possibly Gravatar support.
= When will the "New Author" function be added? =
Hopefully soon.
= What happens to posts and pages when I delete a user assigned to a post or page as a coauthor? =
When a user is deleted from WordPress, they will be removed from all of posts for which they are co-authors.
== Screenshots ==
1. "Post Author(s)" box with multiple authors added
2. Search-as-you-type input box that looks up authors as you type in their name. Fields displayed are: ID, Display Name, and Email.