Co-Authors Plus - Version 2.1.1

Version Description

Download this release

Release Info

Developer batmoo
Plugin Icon wp plugin Co-Authors Plus
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1 to 2.1.1

Files changed (3) hide show
  1. admin.js +1 -1
  2. co-authors.php +1 -1
  3. readme.txt +150 -145
admin.js CHANGED
@@ -113,7 +113,7 @@ jQuery(document).ready(function () {
113
  .html(author.name)
114
  .show()
115
  .next()
116
- .val(author.name)
117
  ;
118
 
119
  // select new author
113
  .html(author.name)
114
  .show()
115
  .next()
116
+ .val(author.login)
117
  ;
118
 
119
  // select new author
co-authors.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Co-Authors Plus
4
  Plugin URI: http://wordpress.org/extend/plugins/co-authors-plus/
5
  Description: 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 allow listing of co-authors. Editors may assign co-authors to a post via the 'Post Author' box. <em>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).</em>
6
- Version: 2.1
7
  Author: Mohammad Jangda
8
  Author URI: http://digitalize.ca
9
  Copyright: Some parts (C) 2009, Mohammad Jangda; Other parts (C) 2008, Weston Ruter, Shepherd Interactive
3
  Plugin Name: Co-Authors Plus
4
  Plugin URI: http://wordpress.org/extend/plugins/co-authors-plus/
5
  Description: 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 allow listing of co-authors. Editors may assign co-authors to a post via the 'Post Author' box. <em>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).</em>
6
+ Version: 2.1.1
7
  Author: Mohammad Jangda
8
  Author URI: http://digitalize.ca
9
  Copyright: Some parts (C) 2009, Mohammad Jangda; Other parts (C) 2008, Weston Ruter, Shepherd Interactive
readme.txt CHANGED
@@ -1,33 +1,38 @@
1
- === Co-Authors Plus ===
2
- Contributors: batmoo
3
- Donate link: http://digitalize.ca/donate
4
- Tags: authors, users, multiple authors, coauthors, multi-author
5
- Tested up to: 2.8
6
- Requires at least: 2.6
7
- Stable tag: 2.1
8
-
9
- Allows multiple authors to be assigned to a Post or Page via search-as-you-type input boxes.
10
-
11
- == Description ==
12
-
13
- 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).
14
-
15
- This plugin is an almost complete rewrite 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). The original plugin was inspired by the 'Multiple Authors' plugin by Mark Jaquith (2005).
16
-
17
- The extended version is created by [Mohammad Jangda](http://digitalize.ca), 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).
18
 
19
  Version 2.0 is a major re-write of the plugin to utilize the WordPress taxonomy system instead of post meta.
20
-
21
- > *See "Other Notes" section for Template Tags and usage information*
22
-
23
- == Changelog ==
24
 
25
- =2009-10-11 / 2.1=
 
 
 
 
 
 
 
 
 
26
 
27
  * Fixed issues related to localization. Thanks to Jan Zombik <zombik@students.uni-mainz.de> for the fixes.
28
  * Added set_time_limit to update function to get around timeout issues when upgrading plugin
29
 
30
- =2009-10-11 / 2.0=
31
 
32
  * Plugin mostly rewritten to make use of taxonomy instead of post_meta
33
  * Can now see all authors of a post under the author column from Edit Posts page
@@ -38,7 +43,7 @@ Version 2.0 is a major re-write of the plugin to utilize the WordPress taxonomy
38
  * FIX: Issues with wp_coauthors_list function
39
  * FIX: Issues with coauthored posts not showing up on author archives
40
 
41
- =2009-06-16 / 1.2.0=
42
 
43
  * FIX: Added compatibility for WordPress 2.8
44
  * FIX: Added new template tags (get_the_coauthor_meta & the_coauthor_meta) to fix issues related to displaying author info on author archive pages. See [Other Notes](http://wordpress.org/extend/plugins/co-authors-plus/other_notes/) for details.
@@ -46,118 +51,118 @@ Version 2.0 is a major re-write of the plugin to utilize the WordPress taxonomy
46
  * FIX: Coauthors should no longer be alphabetically reordered when the post is updated
47
  * FIX: Plugin now used WordPress native AJAX calls to tighten security
48
  * DOCS: Added details about the new template tags
49
-
50
- =2009-04-26 / 1.1.5=
51
-
52
- * FIX: Not searching Updated SQL query for autosuggest to search through first name, last name, and nickname
53
- * FIX: When editing an author, and clicking on a suggested author, the original author was not be removed
54
- * DOCS: Added code comments to javascript; more still to be added
55
- * DOCS: Updated readme information
56
-
57
- =2009-04-25 / 1.1.4=
58
-
59
- * Disabled "New Author" output in suggest box, for now
60
- * Hopefully fixed SVN issue (if you're having trouble with the plugin, please delete the plugin and reinstall)
61
-
62
- =2009-04-23 / 1.1.3=
63
-
64
- * Add blur event to disable input box
65
- * Limit only one edit at a time.
66
- * Checked basic cross-browser compatibility (Firefox 3 OS X, Safari 3 OS X, IE7 Vista).
67
- * Add suggest javascript plugin to Edit Page.
68
-
69
- =2009-04-19 / 1.1.2=
70
-
71
- * Disabled form submit when enter pressed.
72
-
73
- =2009-04-15 / 1.1.1=
74
-
75
- * Changed SQL query to return only contributer-level and above users.
76
-
77
- =2009-04-14: 1.1.0=
78
-
79
- * Initial beta release.
80
-
81
-
82
- == Installation ==
83
-
84
- 1. IMPORTANT: Please disable the original Co-Authors plugin (if you are using it) before installing Co-Authors Plus
85
- 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.
86
- 1. Activate the plugin through the 'Plugins' menu in WordPress.
87
- 1. Place the appropriate coauthors template tags in your template.
88
- 1. Add co-authors to your posts and pages.
89
-
90
-
91
- == Basic Usage and Other Notes ==
92
-
93
- * Only Author-level and above can be added as co-authors. Namely, contributers cannot be added as co-authors.
94
- * As per WordPress design, only Editor-level and above users can change Post Authors. Authors cannot change authors or add co-authors (yet)
95
- * 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.
96
- * The search-as-you-type box starts searching once two letters have been added, and executes a new search with every subsequent letter.
97
- * 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.
98
-
99
-
100
- == Template Tags ==
101
-
102
- New template tags enable listing of co-authors:
103
-
104
- * <code>coauthors()</code>
105
- * <code>coauthors_posts_links()</code>
106
- * <code>coauthors_firstnames()</code>
107
- * <code>coauthors_lastnames()</code>
108
- * <code>coauthors_nicknames()</code>
109
- * <code>coauthors_links()</code>
110
  * <code>coauthors_IDs()</code>
111
-
112
- These template tags correspond to their "<code>the_author*</code>" equivalents; take special note of the pluralization.
113
- Each of these template tags accept four optional arguments:
114
-
115
- 1. <code>between</code>: default ", "
116
- 1. <code>betweenLast</code>: default " and "
117
- 1. <code>before</code>: default ""
118
- 1. <code>after</code>: default ""
119
-
120
- To use them, simply modify the code surrounding all instances of <code>the_author*()</code> to something like as follows:
121
-
122
- if(function_exists('coauthors_posts_links'))
123
- coauthors_posts_links();
124
- else
125
- the_author_posts_link();
126
-
127
- The result of this would be formatted like "John Smith, Jane Doe and Joe Public".
128
-
129
- Note that as of this writing, WordPress does provide a means of extending <code>wp_list_authors()</code>, so
130
- included in this plugin is the function <code>coauthors_wp_list_authors()</code> modified
131
- to take into account co-authored posts; the same arguments are accepted.
132
-
133
- Sometimes you may need fine-graned control over the display of a posts's authors, and in this case you may use
134
- the <code>CoAuthorsIterator</code> class. This class may be instantiated anywhere you may place <code>the_author()</code>
135
- or everywhere if the post ID is provided to the constructor. The instantiated class has the following methods:
136
-
137
- 1. <code>iterate()</code>: advances <code>$authordata</code> to the next co-author; returns <code>false</code> and restores the original <code>$authordata</code> if there are no more authors to iterate.
138
- 1. <code>get_position()</code>: returns the zero-based index of the current author; returns -1 if the iterator is invalid
139
- 1. <code>is_last()</code>: returns <code>true</code> if the current author is the last
140
- 1. <code>is_first()</code>: returns <code>true</code> if the current author is the first
141
- 1. <code>count()</code>: returns the total number of authors
142
- 1. <code>get_all()</code>: returns an array of all of the authors' user data
143
-
144
- For example:
145
-
146
- $i = new CoAuthorsIterator();
147
- print $i->count() == 1 ? 'Author: ' : 'Authors: ';
148
- $i->iterate();
149
- the_author();
150
- while($i->iterate()){
151
- print $i->is_last() ? ' and ' : ', ';
152
- the_author();
153
- }
154
 
155
  = the coauthor meta =
156
 
157
  * <code>get_the_coauthor_meta( $field )</code> (2.8 only)
158
  * <code>the_coauthor_meta( $field )</code> (2.8 only)
159
 
160
- Note: The $field variable corresponds with the same values accepted by the [the author meta](http://codex.wordpress.org/Template_Tags/the_author_meta) function
161
 
162
  = get coauthors =
163
 
@@ -169,19 +174,19 @@ This function returns an array of coauthors for the specified post, or if used i
169
 
170
  * <code>is_coauthor_for_post( $user, $post_id )</code>
171
 
172
- This function allows you to check whether the specified user is coauthor for a post. The $user attribute can be the user ID or username.
173
-
174
-
175
- == Frequently Asked Questions ==
176
-
177
- = What is the main difference between Co-Authors and Co-Authors Plus? =
178
-
179
- 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.
180
-
181
- = What happens to posts and pages when I delete a user assigned to a post or page as a coauthor? =
182
-
183
- When a user is deleted from WordPress, they will be removed from all of posts for which they are co-authors. If you chose to reassign their posts to another user, that user will be set as the coauthor instead.
184
-
185
- == Screenshots ==
186
- 1. "Post Author(s)" box with multiple authors added
187
- 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.
1
+ === Co-Authors Plus ===
2
+ Contributors: batmoo
3
+ Donate link: http://digitalize.ca/donate
4
+ Tags: authors, users, multiple authors, coauthors, multi-author
5
+ Tested up to: 2.8
6
+ Requires at least: 2.6
7
+ Stable tag: 2.1.1
8
+
9
+ Allows multiple authors to be assigned to a Post or Page via search-as-you-type input boxes.
10
+
11
+ == Description ==
12
+
13
+ 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).
14
+
15
+ This plugin is an almost complete rewrite 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). The original plugin was inspired by the 'Multiple Authors' plugin by Mark Jaquith (2005).
16
+
17
+ The extended version is created by [Mohammad Jangda](http://digitalize.ca), 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).
18
 
19
  Version 2.0 is a major re-write of the plugin to utilize the WordPress taxonomy system instead of post meta.
 
 
 
 
20
 
21
+ > *See "Other Notes" section for Template Tags and usage information*
22
+
23
+ == Changelog ==
24
+
25
+ = 2009-10-16 / 2.1.1 =
26
+
27
+ * Fix for coauthors not being added if their username is different from display name
28
+ * Fixes to readme.txt (fixes for textual and puntuation errors, language clarification, minor formatting changes) courtesy of [Waldo Jaquith](http://www.vqronline.org)
29
+
30
+ = 2009-10-11 / 2.1 =
31
 
32
  * Fixed issues related to localization. Thanks to Jan Zombik <zombik@students.uni-mainz.de> for the fixes.
33
  * Added set_time_limit to update function to get around timeout issues when upgrading plugin
34
 
35
+ = 2009-10-11 / 2.0 =
36
 
37
  * Plugin mostly rewritten to make use of taxonomy instead of post_meta
38
  * Can now see all authors of a post under the author column from Edit Posts page
43
  * FIX: Issues with wp_coauthors_list function
44
  * FIX: Issues with coauthored posts not showing up on author archives
45
 
46
+ = 2009-06-16 / 1.2.0 =
47
 
48
  * FIX: Added compatibility for WordPress 2.8
49
  * FIX: Added new template tags (get_the_coauthor_meta & the_coauthor_meta) to fix issues related to displaying author info on author archive pages. See [Other Notes](http://wordpress.org/extend/plugins/co-authors-plus/other_notes/) for details.
51
  * FIX: Coauthors should no longer be alphabetically reordered when the post is updated
52
  * FIX: Plugin now used WordPress native AJAX calls to tighten security
53
  * DOCS: Added details about the new template tags
54
+
55
+ = 2009-04-26 / 1.1.5 =
56
+
57
+ * FIX: Not searching Updated SQL query for autosuggest to search through first name, last name, and nickname
58
+ * FIX: When editing an author, and clicking on a suggested author, the original author was not be removed
59
+ * DOCS: Added code comments to javascript; more still to be added
60
+ * DOCS: Updated readme information
61
+
62
+ = 2009-04-25 / 1.1.4 =
63
+
64
+ * Disabled "New Author" output in suggest box, for now
65
+ * Hopefully fixed SVN issue (if you're having trouble with the plugin, please delete the plugin and reinstall)
66
+
67
+ = 2009-04-23 / 1.1.3 =
68
+
69
+ * Add blur event to disable input box
70
+ * Limit only one edit at a time.
71
+ * Checked basic cross-browser compatibility (Firefox 3 OS X, Safari 3 OS X, IE7 Vista).
72
+ * Add suggest javascript plugin to Edit Page.
73
+
74
+ = 2009-04-19 / 1.1.2 =
75
+
76
+ * Disabled form submit when enter pressed.
77
+
78
+ = 2009-04-15 / 1.1.1 =
79
+
80
+ * Changed SQL query to return only contributer-level and above users.
81
+
82
+ = 2009-04-14: 1.1.0 =
83
+
84
+ * Initial beta release.
85
+
86
+
87
+ == Installation ==
88
+
89
+ 1. IMPORTANT: Please disable the original Co-Authors plugin (if you are using it) before installing Co-Authors Plus
90
+ 1. Extract the coauthors-plus.zip file and upload its contents to the `/wp-content/plugins/` directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
91
+ 1. Activate the plugin through the "Plugins" menu in WordPress.
92
+ 1. Place the appropriate coauthors template tags in your template.
93
+ 1. Add co-authors to your posts and pages.
94
+
95
+
96
+ == Basic Usage and Other Notes ==
97
+
98
+ * Contributor-level and above can be added as co-authors. An option added as of 2.0 allows subscribers to be added as coauthors as well.
99
+ * As per WordPress design, only Editor-level and above users can change Post Authors. Authors cannot change authors or add co-authors (yet).
100
+ * As per WordPress design, when an editor creates a new Post or Page, they are by default added as an author. However, they can be replaced by clicking on their name and typing in the name of the new author.
101
+ * The search-as-you-type box starts searching once two letters have been added, and executes a new search with every subsequent letter.
102
+ * 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.
103
+
104
+
105
+ == Template Tags ==
106
+
107
+ New template tags enable listing of co-authors:
108
+
109
+ * <code>coauthors()</code>
110
+ * <code>coauthors_posts_links()</code>
111
+ * <code>coauthors_firstnames()</code>
112
+ * <code>coauthors_lastnames()</code>
113
+ * <code>coauthors_nicknames()</code>
114
+ * <code>coauthors_links()</code>
115
  * <code>coauthors_IDs()</code>
116
+
117
+ These template tags correspond to their "<code>the_author*</code>" equivalents; take special note of the pluralization.
118
+ Each of these template tags accept four optional arguments:
119
+
120
+ 1. <code>between</code>: default ", "
121
+ 1. <code>betweenLast</code>: default " and "
122
+ 1. <code>before</code>: default ""
123
+ 1. <code>after</code>: default ""
124
+
125
+ To use them, simply modify the code surrounding all instances of <code>the_author*()</code> to something like the following example:
126
+
127
+ if(function_exists('coauthors_posts_links'))
128
+ coauthors_posts_links();
129
+ else
130
+ the_author_posts_link();
131
+
132
+ The result of this would be formatted like "John Smith, Jane Doe and Joe Public".
133
+
134
+ Note that as of this writing, WordPress does provide a means of extending <code>wp_list_authors()</code>, so
135
+ included in this plugin is the function <code>coauthors_wp_list_authors()</code> modified
136
+ to take into account co-authored posts; the same arguments are accepted.
137
+
138
+ Sometimes you may need fine-grained control over the display of a posts's authors, and in this case you may use
139
+ the <code>CoAuthorsIterator</code> class. This class may be instantiated anywhere you may place <code>the_author()</code>
140
+ or everywhere if the post ID is provided to the constructor. The instantiated class has the following methods:
141
+
142
+ 1. <code>iterate()</code>: advances <code>$authordata</code> to the next co-author; returns <code>false</code> and restores the original <code>$authordata</code> if there are no more authors to iterate.
143
+ 1. <code>get_position()</code>: returns the zero-based index of the current author; returns -1 if the iterator is invalid.
144
+ 1. <code>is_last()</code>: returns <code>true</code> if the current author is the last.
145
+ 1. <code>is_first()</code>: returns <code>true</code> if the current author is the first.
146
+ 1. <code>count()</code>: returns the total number of authors.
147
+ 1. <code>get_all()</code>: returns an array of all of the authors' user data.
148
+
149
+ For example:
150
+
151
+ $i = new CoAuthorsIterator();
152
+ print $i->count() == 1 ? 'Author: ' : 'Authors: ';
153
+ $i->iterate();
154
+ the_author();
155
+ while($i->iterate()){
156
+ print $i->is_last() ? ' and ' : ', ';
157
+ the_author();
158
+ }
159
 
160
  = the coauthor meta =
161
 
162
  * <code>get_the_coauthor_meta( $field )</code> (2.8 only)
163
  * <code>the_coauthor_meta( $field )</code> (2.8 only)
164
 
165
+ Note: The $field variable corresponds with the same values accepted by the [the author meta](http://codex.wordpress.org/Template_Tags/the_author_meta) function.
166
 
167
  = get coauthors =
168
 
174
 
175
  * <code>is_coauthor_for_post( $user, $post_id )</code>
176
 
177
+ This function allows you to check whether the specified user is coauthor for a post. The $user attribute can be the user ID or username.
178
+
179
+
180
+ == Frequently Asked Questions ==
181
+
182
+ = What is the main difference between Co-Authors and Co-Authors Plus? =
183
+
184
+ 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.
185
+
186
+ = What happens to posts and pages when I delete a user assigned to a post or page as a coauthor? =
187
+
188
+ When a user is deleted from WordPress, they will be removed from all posts for which they are co-authors. If you chose to reassign their posts to another user, that user will be set as the coauthor instead.
189
+
190
+ == Screenshots ==
191
+ 1. "Post Author(s)" box with multiple authors added
192
+ 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.