Co-Authors Plus - Version 3.0.1

Version Description

Bug fixes and minor enhancements

=

Download this release

Release Info

Developer danielbachhuber
Plugin Icon wp plugin Co-Authors Plus
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0 to 3.0.1

co-authors-plus.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. This plugin is an extended version of the Co-Authors plugin developed by Weston Ruter.
6
- Version: 3.0
7
  Author: Mohammad Jangda, Daniel Bachhuber, Automattic
8
  Copyright: 2008-2012 Shared and distributed between Mohammad Jangda, Daniel Bachhuber, Weston Ruter
9
 
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
 
25
  */
26
 
27
- define( 'COAUTHORS_PLUS_VERSION', '3.0' );
28
 
29
  define( 'COAUTHORS_PLUS_PATH', dirname( __FILE__ ) );
30
  define( 'COAUTHORS_PLUS_URL', plugin_dir_url( __FILE__ ) );
@@ -156,7 +156,7 @@ class coauthors_plus {
156
  );
157
  $post_types_with_authors = array_values( get_post_types() );
158
  foreach( $post_types_with_authors as $key => $name ) {
159
- if ( ! post_type_supports( $name, 'author' ) )
160
  unset( $post_types_with_authors[$key] );
161
  }
162
  $this->supported_post_types = apply_filters( 'coauthors_supported_post_types', $post_types_with_authors );
@@ -605,7 +605,7 @@ class coauthors_plus {
605
  return $data;
606
 
607
  // Bail on revisions
608
- if ( $data['post_type'] == 'revision' )
609
  return $data;
610
 
611
  // This action happens when a post is saved while editing a post
@@ -661,11 +661,13 @@ class coauthors_plus {
661
  * @param $post_ID
662
  */
663
  function coauthors_update_post( $post_id, $post ) {
664
- $post_type = $post->post_type;
665
 
666
  if ( defined( 'DOING_AUTOSAVE' ) && !DOING_AUTOSAVE )
667
  return;
668
 
 
 
 
669
  if( isset( $_POST['coauthors-nonce'] ) && isset( $_POST['coauthors'] ) ) {
670
  check_admin_referer( 'coauthors-edit', 'coauthors-nonce' );
671
 
@@ -790,6 +792,10 @@ class coauthors_plus {
790
  $current_user = wp_get_current_user();
791
  if ( ! $current_user )
792
  return false;
 
 
 
 
793
  $can_set_authors = isset( $current_user->allcaps['edit_others_posts'] ) ? $current_user->allcaps['edit_others_posts'] : false;
794
 
795
  return apply_filters( 'coauthors_plus_edit_authors', $can_set_authors );
@@ -1062,7 +1068,7 @@ class coauthors_plus {
1062
  return $allcaps;
1063
 
1064
  // We won't be doing any modification if they aren't already a co-author on the post
1065
- if( ! is_coauthor_for_post( $user_id, $post_id ) )
1066
  return $allcaps;
1067
 
1068
  $current_user = wp_get_current_user();
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. This plugin is an extended version of the Co-Authors plugin developed by Weston Ruter.
6
+ Version: 3.0.1
7
  Author: Mohammad Jangda, Daniel Bachhuber, Automattic
8
  Copyright: 2008-2012 Shared and distributed between Mohammad Jangda, Daniel Bachhuber, Weston Ruter
9
 
24
 
25
  */
26
 
27
+ define( 'COAUTHORS_PLUS_VERSION', '3.0.1' );
28
 
29
  define( 'COAUTHORS_PLUS_PATH', dirname( __FILE__ ) );
30
  define( 'COAUTHORS_PLUS_URL', plugin_dir_url( __FILE__ ) );
156
  );
157
  $post_types_with_authors = array_values( get_post_types() );
158
  foreach( $post_types_with_authors as $key => $name ) {
159
+ if ( ! post_type_supports( $name, 'author' ) || 'revision' == $name )
160
  unset( $post_types_with_authors[$key] );
161
  }
162
  $this->supported_post_types = apply_filters( 'coauthors_supported_post_types', $post_types_with_authors );
605
  return $data;
606
 
607
  // Bail on revisions
608
+ if ( ! $this->is_post_type_enabled( $data['post_type'] ) )
609
  return $data;
610
 
611
  // This action happens when a post is saved while editing a post
661
  * @param $post_ID
662
  */
663
  function coauthors_update_post( $post_id, $post ) {
 
664
 
665
  if ( defined( 'DOING_AUTOSAVE' ) && !DOING_AUTOSAVE )
666
  return;
667
 
668
+ if ( ! $this->is_post_type_enabled( $post->post_type ) )
669
+ return;
670
+
671
  if( isset( $_POST['coauthors-nonce'] ) && isset( $_POST['coauthors'] ) ) {
672
  check_admin_referer( 'coauthors-edit', 'coauthors-nonce' );
673
 
792
  $current_user = wp_get_current_user();
793
  if ( ! $current_user )
794
  return false;
795
+ // Super admins can do anything
796
+ if ( function_exists( 'is_super_admin' ) && is_super_admin() )
797
+ return true;
798
+
799
  $can_set_authors = isset( $current_user->allcaps['edit_others_posts'] ) ? $current_user->allcaps['edit_others_posts'] : false;
800
 
801
  return apply_filters( 'coauthors_plus_edit_authors', $can_set_authors );
1068
  return $allcaps;
1069
 
1070
  // We won't be doing any modification if they aren't already a co-author on the post
1071
+ if( ! is_user_logged_in() || ! is_coauthor_for_post( $user_id, $post_id ) )
1072
  return $allcaps;
1073
 
1074
  $current_user = wp_get_current_user();
js/guest-authors.js CHANGED
@@ -12,7 +12,8 @@ jQuery(document).ready(function($){
12
  data: function( term, page ) {
13
  return {
14
  q: term,
15
- action: 'search_coauthors_to_assign'
 
16
  };
17
  },
18
  results: function( data, page ) {
12
  data: function( term, page ) {
13
  return {
14
  q: term,
15
+ action: 'search_coauthors_to_assign',
16
+ guest_author: $('#id').val()
17
  };
18
  },
19
  results: function( data, page ) {
languages/co-authors-plus.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Co-Authors Plus package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Co-Authors Plus 3.0-beta1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/co-authors-plus\n"
7
- "POT-Creation-Date: 2012-11-12 05:25:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,174 +12,174 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: co-authors-plus.php:314 co-authors-plus.php:408 co-authors-plus.php:1173
16
  msgid "Authors"
17
  msgstr ""
18
 
19
- #: co-authors-plus.php:369
20
  msgid ""
21
  "<strong>Note:</strong> To edit post authors, please enable javascript or use "
22
  "a javascript-capable browser"
23
  msgstr ""
24
 
25
- #: co-authors-plus.php:376 co-authors-plus.php:973
26
  msgid ""
27
  "Click on an author to change them. Drag to change their order. Click on "
28
  "<strong>Remove</strong> to remove them."
29
  msgstr ""
30
 
31
- #: co-authors-plus.php:450 php/class-coauthors-wp-list-table.php:137
32
  msgid "Posts"
33
  msgstr ""
34
 
35
- #: co-authors-plus.php:467
36
  msgid "View posts by this author"
37
  msgstr ""
38
 
39
- #: co-authors-plus.php:502
40
  msgid "No co-author exists for that term"
41
  msgstr ""
42
 
43
- #: co-authors-plus.php:968 php/class-coauthors-wp-list-table.php:188
44
  msgid "Edit"
45
  msgstr ""
46
 
47
- #: co-authors-plus.php:969
48
  msgid "Remove"
49
  msgstr ""
50
 
51
- #: co-authors-plus.php:970
52
  msgid "Are you sure you want to remove this author?"
53
  msgstr ""
54
 
55
- #: co-authors-plus.php:971
56
  msgid "Click to change this author, or drag to change their position"
57
  msgstr ""
58
 
59
- #: co-authors-plus.php:972
60
  msgid "Search for an author"
61
  msgstr ""
62
 
63
- #: co-authors-plus.php:1008
64
  msgid "Mine"
65
  msgstr ""
66
 
67
- #: co-authors-plus.php:1245
68
  msgid "New comment on your post \"%s\""
69
  msgstr ""
70
 
71
  #. translators: 1: comment author, 2: author IP, 3: author domain
72
- #: co-authors-plus.php:1247 co-authors-plus.php:1364
73
  msgid "Author : %1$s (IP: %2$s , %3$s)"
74
  msgstr ""
75
 
76
- #: co-authors-plus.php:1248 co-authors-plus.php:1365
77
  msgid "E-mail : %s"
78
  msgstr ""
79
 
80
- #: co-authors-plus.php:1249 co-authors-plus.php:1259 co-authors-plus.php:1268
81
- #: co-authors-plus.php:1351 co-authors-plus.php:1358 co-authors-plus.php:1366
82
  msgid "URL : %s"
83
  msgstr ""
84
 
85
- #: co-authors-plus.php:1250 co-authors-plus.php:1367
86
  msgid "Whois : http://whois.arin.net/rest/ip/%s"
87
  msgstr ""
88
 
89
- #: co-authors-plus.php:1251 co-authors-plus.php:1368
90
  msgid "Comment: "
91
  msgstr ""
92
 
93
- #: co-authors-plus.php:1252
94
  msgid "You can see all comments on this post here: "
95
  msgstr ""
96
 
97
  #. translators: 1: blog name, 2: post title
98
- #: co-authors-plus.php:1254
99
  msgid "[%1$s] Comment: \"%2$s\""
100
  msgstr ""
101
 
102
- #: co-authors-plus.php:1256
103
  msgid "New trackback on your post \"%s\""
104
  msgstr ""
105
 
106
  #. translators: 1: website name, 2: author IP, 3: author domain
107
  #. translators: 1: comment author, 2: author IP, 3: author domain
108
- #: co-authors-plus.php:1258 co-authors-plus.php:1267
109
  msgid "Website: %1$s (IP: %2$s , %3$s)"
110
  msgstr ""
111
 
112
- #: co-authors-plus.php:1260 co-authors-plus.php:1269
113
  msgid "Excerpt: "
114
  msgstr ""
115
 
116
- #: co-authors-plus.php:1261
117
  msgid "You can see all trackbacks on this post here: "
118
  msgstr ""
119
 
120
  #. translators: 1: blog name, 2: post title
121
- #: co-authors-plus.php:1263
122
  msgid "[%1$s] Trackback: \"%2$s\""
123
  msgstr ""
124
 
125
- #: co-authors-plus.php:1265
126
  msgid "New pingback on your post \"%s\""
127
  msgstr ""
128
 
129
- #: co-authors-plus.php:1270
130
  msgid "You can see all pingbacks on this post here: "
131
  msgstr ""
132
 
133
  #. translators: 1: blog name, 2: post title
134
- #: co-authors-plus.php:1272
135
  msgid "[%1$s] Pingback: \"%2$s\""
136
  msgstr ""
137
 
138
- #: co-authors-plus.php:1275
139
  msgid "Permalink: %s"
140
  msgstr ""
141
 
142
- #: co-authors-plus.php:1277 co-authors-plus.php:1374
143
  msgid "Trash it: %s"
144
  msgstr ""
145
 
146
- #: co-authors-plus.php:1279 co-authors-plus.php:1376
147
  msgid "Delete it: %s"
148
  msgstr ""
149
 
150
- #: co-authors-plus.php:1280 co-authors-plus.php:1377
151
  msgid "Spam it: %s"
152
  msgstr ""
153
 
154
- #: co-authors-plus.php:1348
155
  msgid "A new trackback on the post \"%s\" is waiting for your approval"
156
  msgstr ""
157
 
158
- #: co-authors-plus.php:1350 co-authors-plus.php:1357
159
  msgid "Website : %1$s (IP: %2$s , %3$s)"
160
  msgstr ""
161
 
162
- #: co-authors-plus.php:1352
163
  msgid "Trackback excerpt: "
164
  msgstr ""
165
 
166
- #: co-authors-plus.php:1355
167
  msgid "A new pingback on the post \"%s\" is waiting for your approval"
168
  msgstr ""
169
 
170
- #: co-authors-plus.php:1359
171
  msgid "Pingback excerpt: "
172
  msgstr ""
173
 
174
- #: co-authors-plus.php:1362
175
  msgid "A new comment on the post \"%s\" is waiting for your approval"
176
  msgstr ""
177
 
178
- #: co-authors-plus.php:1372
179
  msgid "Approve it: %s"
180
  msgstr ""
181
 
182
- #: co-authors-plus.php:1379
183
  msgid ""
184
  "Currently %s comment is waiting for approval. Please visit the moderation "
185
  "panel:"
@@ -189,293 +189,293 @@ msgid_plural ""
189
  msgstr[0] ""
190
  msgstr[1] ""
191
 
192
- #: co-authors-plus.php:1383
193
  msgid "[%1$s] Please moderate: \"%2$s\""
194
  msgstr ""
195
 
196
- #: php/class-coauthors-guest-authors.php:78
197
  msgid "Guest Author"
198
  msgstr ""
199
 
200
- #: php/class-coauthors-guest-authors.php:79
201
  msgid "Guest Authors"
202
  msgstr ""
203
 
204
- #: php/class-coauthors-guest-authors.php:80
205
  msgid "All Guest Authors"
206
  msgstr ""
207
 
208
- #: php/class-coauthors-guest-authors.php:81
209
  msgid "Add New Guest Author"
210
  msgstr ""
211
 
212
- #: php/class-coauthors-guest-authors.php:82
213
  msgid "Edit Guest Author"
214
  msgstr ""
215
 
216
- #: php/class-coauthors-guest-authors.php:83
217
  msgid "New Guest Author"
218
  msgstr ""
219
 
220
- #: php/class-coauthors-guest-authors.php:84
221
  msgid "View Guest Author"
222
  msgstr ""
223
 
224
- #: php/class-coauthors-guest-authors.php:85
225
  msgid "Search Guest Authors"
226
  msgstr ""
227
 
228
- #: php/class-coauthors-guest-authors.php:86
229
  msgid "No guest authors found"
230
  msgstr ""
231
 
232
- #: php/class-coauthors-guest-authors.php:87
233
  msgid "No guest authors found in Trash"
234
  msgstr ""
235
 
236
- #: php/class-coauthors-guest-authors.php:88
237
  msgid "Update Guest Author"
238
  msgstr ""
239
 
240
- #: php/class-coauthors-guest-authors.php:89
241
  msgid "About the guest author"
242
  msgstr ""
243
 
244
- #: php/class-coauthors-guest-authors.php:98
245
  msgctxt "co-authors-plus"
246
  msgid "Add New"
247
  msgstr ""
248
 
249
- #: php/class-coauthors-guest-authors.php:142
250
- #: php/class-coauthors-guest-authors.php:148
251
  msgid "Guest author updated. <a href=\"%s\">View profile</a>"
252
  msgstr ""
253
 
254
- #: php/class-coauthors-guest-authors.php:143
255
  msgid "Custom field updated."
256
  msgstr ""
257
 
258
- #: php/class-coauthors-guest-authors.php:144
259
  msgid "Custom field deleted."
260
  msgstr ""
261
 
262
- #: php/class-coauthors-guest-authors.php:145
263
  msgid "Guest author updated."
264
  msgstr ""
265
 
266
  #. translators: %s: date and time of the revision
267
- #: php/class-coauthors-guest-authors.php:147
268
  msgid "Guest author restored to revision from %s"
269
  msgstr ""
270
 
271
- #: php/class-coauthors-guest-authors.php:149
272
  msgid "Guest author saved."
273
  msgstr ""
274
 
275
- #: php/class-coauthors-guest-authors.php:150
276
  msgid ""
277
  "Guest author submitted. <a target=\"_blank\" href=\"%s\">Preview profile</a>"
278
  msgstr ""
279
 
280
- #: php/class-coauthors-guest-authors.php:151
281
  msgid ""
282
  "Guest author scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
283
  "\"%2$s\">Preview profile</a>"
284
  msgstr ""
285
 
286
  #. translators: Publish box date format, see http:php.net/date
287
- #: php/class-coauthors-guest-authors.php:153
288
  msgid "M j, Y @ G:i"
289
  msgstr ""
290
 
291
- #: php/class-coauthors-guest-authors.php:154
292
  msgid ""
293
  "Guest author updated. <a target=\"_blank\" href=\"%s\">Preview profile</a>"
294
  msgstr ""
295
 
296
- #: php/class-coauthors-guest-authors.php:171
297
- #: php/class-coauthors-guest-authors.php:205
298
- #: php/class-coauthors-guest-authors.php:388
299
  msgid "Doin' something fishy, huh?"
300
  msgstr ""
301
 
302
- #: php/class-coauthors-guest-authors.php:174
303
- #: php/class-coauthors-guest-authors.php:209
304
  msgid "You don't have permission to perform this action."
305
  msgstr ""
306
 
307
- #: php/class-coauthors-guest-authors.php:214
308
- #: php/class-coauthors-guest-authors.php:393
309
  msgid "Guest author can't be deleted because it doesn't exist."
310
  msgstr ""
311
 
312
- #: php/class-coauthors-guest-authors.php:228
313
  msgid "Co-author does not exists. Try again?"
314
  msgstr ""
315
 
316
- #: php/class-coauthors-guest-authors.php:236
317
  msgid "Please make sure to pick an option."
318
  msgstr ""
319
 
320
- #: php/class-coauthors-guest-authors.php:348
321
  msgid "Guest author deleted."
322
  msgstr ""
323
 
324
- #: php/class-coauthors-guest-authors.php:370
325
  msgid "Save"
326
  msgstr ""
327
 
328
- #: php/class-coauthors-guest-authors.php:371
329
  msgid "Unique Slug"
330
  msgstr ""
331
 
332
- #: php/class-coauthors-guest-authors.php:373
333
  msgid "Name"
334
  msgstr ""
335
 
336
- #: php/class-coauthors-guest-authors.php:374
337
  msgid "Contact Info"
338
  msgstr ""
339
 
340
- #: php/class-coauthors-guest-authors.php:397
341
  msgid "Delete %s"
342
  msgstr ""
343
 
344
- #: php/class-coauthors-guest-authors.php:398
345
  msgid "You have specified this guest author for deletion:"
346
  msgstr ""
347
 
348
- #: php/class-coauthors-guest-authors.php:400
349
  msgid "What should be done with posts assigned to this guest author?"
350
  msgstr ""
351
 
352
- #: php/class-coauthors-guest-authors.php:401
353
  msgid ""
354
  "Note: If you'd like to delete the guest author and all of their posts, you "
355
  "should delete their posts first and then come back to delete the guest "
356
  "author."
357
  msgstr ""
358
 
359
- #: php/class-coauthors-guest-authors.php:410
360
  msgid "Reassign to another co-author:"
361
  msgstr ""
362
 
363
- #: php/class-coauthors-guest-authors.php:416
364
  msgid "Leave posts assigned to the mapped user, %s."
365
  msgstr ""
366
 
367
- #: php/class-coauthors-guest-authors.php:421
368
  msgid "Remove byline from posts (but leave each post in its current status)."
369
  msgstr ""
370
 
371
- #: php/class-coauthors-guest-authors.php:424
372
  msgid "Confirm Deletion"
373
  msgstr ""
374
 
375
- #: php/class-coauthors-guest-authors.php:433
376
  msgid "Add New"
377
  msgstr ""
378
 
379
- #: php/class-coauthors-guest-authors.php:490
380
  msgid "WordPress User Mapping"
381
  msgstr ""
382
 
383
- #: php/class-coauthors-guest-authors.php:492
384
  msgid "-- Not mapped --"
385
  msgstr ""
386
 
387
- #: php/class-coauthors-guest-authors.php:594
388
  msgid "Guest authors cannot be created without display names."
389
  msgstr ""
390
 
391
- #: php/class-coauthors-guest-authors.php:601
392
  msgid ""
393
  "Guest authors cannot be created with the same user_login value as a user. "
394
  "Try creating a profile from the user instead"
395
  msgstr ""
396
 
397
- #: php/class-coauthors-guest-authors.php:606
398
  msgid "Display name conflicts with another guest author display name."
399
  msgstr ""
400
 
401
- #: php/class-coauthors-guest-authors.php:750
402
  msgid "ID"
403
  msgstr ""
404
 
405
- #: php/class-coauthors-guest-authors.php:756
406
- #: php/class-coauthors-wp-list-table.php:132
407
  msgid "Display Name"
408
  msgstr ""
409
 
410
- #: php/class-coauthors-guest-authors.php:762
411
- #: php/class-coauthors-wp-list-table.php:133
412
  msgid "First Name"
413
  msgstr ""
414
 
415
- #: php/class-coauthors-guest-authors.php:767
416
- #: php/class-coauthors-wp-list-table.php:134
417
  msgid "Last Name"
418
  msgstr ""
419
 
420
- #: php/class-coauthors-guest-authors.php:772
421
  msgid "Slug"
422
  msgstr ""
423
 
424
- #: php/class-coauthors-guest-authors.php:779
425
- #: php/class-coauthors-wp-list-table.php:135
426
  msgid "E-mail"
427
  msgstr ""
428
 
429
- #: php/class-coauthors-guest-authors.php:784
430
- #: php/class-coauthors-wp-list-table.php:136
431
  msgid "Linked Account"
432
  msgstr ""
433
 
434
- #: php/class-coauthors-guest-authors.php:789
435
  msgid "Website"
436
  msgstr ""
437
 
438
- #: php/class-coauthors-guest-authors.php:794
439
  msgid "AIM"
440
  msgstr ""
441
 
442
- #: php/class-coauthors-guest-authors.php:799
443
  msgid "Yahoo IM"
444
  msgstr ""
445
 
446
- #: php/class-coauthors-guest-authors.php:804
447
  msgid "Jabber / Google Talk"
448
  msgstr ""
449
 
450
- #: php/class-coauthors-guest-authors.php:809
451
  msgid "Biographical Info"
452
  msgstr ""
453
 
454
- #: php/class-coauthors-guest-authors.php:938
455
  msgid "%s is a required field"
456
  msgstr ""
457
 
458
- #: php/class-coauthors-guest-authors.php:944
459
  msgid "user_login cannot duplicate existing guest author or mapped user"
460
  msgstr ""
461
 
462
- #: php/class-coauthors-guest-authors.php:989
463
  msgid "Guest author does not exist"
464
  msgstr ""
465
 
466
- #: php/class-coauthors-guest-authors.php:1001
467
  msgid "Reassignment co-author does not exist"
468
  msgstr ""
469
 
470
- #: php/class-coauthors-guest-authors.php:1033
471
  msgid "No user exists with that ID"
472
  msgstr ""
473
 
474
- #: php/class-coauthors-guest-authors.php:1088
475
  msgid "Edit Profile"
476
  msgstr ""
477
 
478
- #: php/class-coauthors-guest-authors.php:1096
479
  msgid "Create Profile"
480
  msgstr ""
481
 
@@ -487,69 +487,69 @@ msgstr ""
487
  msgid "Co-Author"
488
  msgstr ""
489
 
490
- #: php/class-coauthors-wp-list-table.php:68
491
  msgid "Show all"
492
  msgstr ""
493
 
494
- #: php/class-coauthors-wp-list-table.php:69
495
  msgid "With linked account"
496
  msgstr ""
497
 
498
- #: php/class-coauthors-wp-list-table.php:70
499
  msgid "Without linked account"
500
  msgstr ""
501
 
502
- #: php/class-coauthors-wp-list-table.php:122
503
  msgid "No matching guest authors were found."
504
  msgstr ""
505
 
506
- #: php/class-coauthors-wp-list-table.php:189
507
  msgid "Delete"
508
  msgstr ""
509
 
510
- #: php/class-coauthors-wp-list-table.php:190
511
  msgid "View Posts"
512
  msgstr ""
513
 
514
- #: php/class-coauthors-wp-list-table.php:238
515
  msgid "Filter"
516
  msgstr ""
517
 
518
- #: php/class-wp-cli.php:167
519
  msgid "Please specify a valid user_login"
520
  msgstr ""
521
 
522
- #: php/class-wp-cli.php:170
523
  msgid "Please specify a valid co-author login"
524
  msgstr ""
525
 
526
- #: php/class-wp-cli.php:177
527
  msgid "Skipping - Post #%d already has co-authors assigned: %s"
528
  msgstr ""
529
 
530
- #: php/class-wp-cli.php:182
531
  msgid "Updating - Adding %s's byline to post #%d"
532
  msgstr ""
533
 
534
- #: php/class-wp-cli.php:187
535
  msgid "All done! %d posts were affected."
536
  msgstr ""
537
 
538
- #: template-tags.php:79
539
  msgid ""
540
  "No post ID provided for CoAuthorsIterator constructor. Are you not in a loop "
541
  "or is $post not set?"
542
  msgstr ""
543
 
544
- #: template-tags.php:133
545
  msgid " and "
546
  msgstr ""
547
 
548
- #: template-tags.php:205 template-tags.php:353
549
  msgid "Posts by %s"
550
  msgstr ""
551
 
552
- #: template-tags.php:254
553
  msgid "Visit %s&#8217;s website"
554
  msgstr ""
555
 
2
  # This file is distributed under the same license as the Co-Authors Plus package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Co-Authors Plus 3.0.1-working\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/co-authors-plus\n"
7
+ "POT-Creation-Date: 2012-11-21 21:17:39+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: co-authors-plus.php:287 co-authors-plus.php:382 co-authors-plus.php:1158
16
  msgid "Authors"
17
  msgstr ""
18
 
19
+ #: co-authors-plus.php:342
20
  msgid ""
21
  "<strong>Note:</strong> To edit post authors, please enable javascript or use "
22
  "a javascript-capable browser"
23
  msgstr ""
24
 
25
+ #: co-authors-plus.php:349 co-authors-plus.php:956
26
  msgid ""
27
  "Click on an author to change them. Drag to change their order. Click on "
28
  "<strong>Remove</strong> to remove them."
29
  msgstr ""
30
 
31
+ #: co-authors-plus.php:425 php/class-coauthors-wp-list-table.php:148
32
  msgid "Posts"
33
  msgstr ""
34
 
35
+ #: co-authors-plus.php:442
36
  msgid "View posts by this author"
37
  msgstr ""
38
 
39
+ #: co-authors-plus.php:481
40
  msgid "No co-author exists for that term"
41
  msgstr ""
42
 
43
+ #: co-authors-plus.php:951 php/class-coauthors-wp-list-table.php:205
44
  msgid "Edit"
45
  msgstr ""
46
 
47
+ #: co-authors-plus.php:952
48
  msgid "Remove"
49
  msgstr ""
50
 
51
+ #: co-authors-plus.php:953
52
  msgid "Are you sure you want to remove this author?"
53
  msgstr ""
54
 
55
+ #: co-authors-plus.php:954
56
  msgid "Click to change this author, or drag to change their position"
57
  msgstr ""
58
 
59
+ #: co-authors-plus.php:955
60
  msgid "Search for an author"
61
  msgstr ""
62
 
63
+ #: co-authors-plus.php:993
64
  msgid "Mine"
65
  msgstr ""
66
 
67
+ #: co-authors-plus.php:1230
68
  msgid "New comment on your post \"%s\""
69
  msgstr ""
70
 
71
  #. translators: 1: comment author, 2: author IP, 3: author domain
72
+ #: co-authors-plus.php:1232 co-authors-plus.php:1349
73
  msgid "Author : %1$s (IP: %2$s , %3$s)"
74
  msgstr ""
75
 
76
+ #: co-authors-plus.php:1233 co-authors-plus.php:1350
77
  msgid "E-mail : %s"
78
  msgstr ""
79
 
80
+ #: co-authors-plus.php:1234 co-authors-plus.php:1244 co-authors-plus.php:1253
81
+ #: co-authors-plus.php:1336 co-authors-plus.php:1343 co-authors-plus.php:1351
82
  msgid "URL : %s"
83
  msgstr ""
84
 
85
+ #: co-authors-plus.php:1235 co-authors-plus.php:1352
86
  msgid "Whois : http://whois.arin.net/rest/ip/%s"
87
  msgstr ""
88
 
89
+ #: co-authors-plus.php:1236 co-authors-plus.php:1353
90
  msgid "Comment: "
91
  msgstr ""
92
 
93
+ #: co-authors-plus.php:1237
94
  msgid "You can see all comments on this post here: "
95
  msgstr ""
96
 
97
  #. translators: 1: blog name, 2: post title
98
+ #: co-authors-plus.php:1239
99
  msgid "[%1$s] Comment: \"%2$s\""
100
  msgstr ""
101
 
102
+ #: co-authors-plus.php:1241
103
  msgid "New trackback on your post \"%s\""
104
  msgstr ""
105
 
106
  #. translators: 1: website name, 2: author IP, 3: author domain
107
  #. translators: 1: comment author, 2: author IP, 3: author domain
108
+ #: co-authors-plus.php:1243 co-authors-plus.php:1252
109
  msgid "Website: %1$s (IP: %2$s , %3$s)"
110
  msgstr ""
111
 
112
+ #: co-authors-plus.php:1245 co-authors-plus.php:1254
113
  msgid "Excerpt: "
114
  msgstr ""
115
 
116
+ #: co-authors-plus.php:1246
117
  msgid "You can see all trackbacks on this post here: "
118
  msgstr ""
119
 
120
  #. translators: 1: blog name, 2: post title
121
+ #: co-authors-plus.php:1248
122
  msgid "[%1$s] Trackback: \"%2$s\""
123
  msgstr ""
124
 
125
+ #: co-authors-plus.php:1250
126
  msgid "New pingback on your post \"%s\""
127
  msgstr ""
128
 
129
+ #: co-authors-plus.php:1255
130
  msgid "You can see all pingbacks on this post here: "
131
  msgstr ""
132
 
133
  #. translators: 1: blog name, 2: post title
134
+ #: co-authors-plus.php:1257
135
  msgid "[%1$s] Pingback: \"%2$s\""
136
  msgstr ""
137
 
138
+ #: co-authors-plus.php:1260
139
  msgid "Permalink: %s"
140
  msgstr ""
141
 
142
+ #: co-authors-plus.php:1262 co-authors-plus.php:1359
143
  msgid "Trash it: %s"
144
  msgstr ""
145
 
146
+ #: co-authors-plus.php:1264 co-authors-plus.php:1361
147
  msgid "Delete it: %s"
148
  msgstr ""
149
 
150
+ #: co-authors-plus.php:1265 co-authors-plus.php:1362
151
  msgid "Spam it: %s"
152
  msgstr ""
153
 
154
+ #: co-authors-plus.php:1333
155
  msgid "A new trackback on the post \"%s\" is waiting for your approval"
156
  msgstr ""
157
 
158
+ #: co-authors-plus.php:1335 co-authors-plus.php:1342
159
  msgid "Website : %1$s (IP: %2$s , %3$s)"
160
  msgstr ""
161
 
162
+ #: co-authors-plus.php:1337
163
  msgid "Trackback excerpt: "
164
  msgstr ""
165
 
166
+ #: co-authors-plus.php:1340
167
  msgid "A new pingback on the post \"%s\" is waiting for your approval"
168
  msgstr ""
169
 
170
+ #: co-authors-plus.php:1344
171
  msgid "Pingback excerpt: "
172
  msgstr ""
173
 
174
+ #: co-authors-plus.php:1347
175
  msgid "A new comment on the post \"%s\" is waiting for your approval"
176
  msgstr ""
177
 
178
+ #: co-authors-plus.php:1357
179
  msgid "Approve it: %s"
180
  msgstr ""
181
 
182
+ #: co-authors-plus.php:1364
183
  msgid ""
184
  "Currently %s comment is waiting for approval. Please visit the moderation "
185
  "panel:"
189
  msgstr[0] ""
190
  msgstr[1] ""
191
 
192
+ #: co-authors-plus.php:1368
193
  msgid "[%1$s] Please moderate: \"%2$s\""
194
  msgstr ""
195
 
196
+ #: php/class-coauthors-guest-authors.php:77
197
  msgid "Guest Author"
198
  msgstr ""
199
 
200
+ #: php/class-coauthors-guest-authors.php:78
201
  msgid "Guest Authors"
202
  msgstr ""
203
 
204
+ #: php/class-coauthors-guest-authors.php:79
205
  msgid "All Guest Authors"
206
  msgstr ""
207
 
208
+ #: php/class-coauthors-guest-authors.php:80
209
  msgid "Add New Guest Author"
210
  msgstr ""
211
 
212
+ #: php/class-coauthors-guest-authors.php:81
213
  msgid "Edit Guest Author"
214
  msgstr ""
215
 
216
+ #: php/class-coauthors-guest-authors.php:82
217
  msgid "New Guest Author"
218
  msgstr ""
219
 
220
+ #: php/class-coauthors-guest-authors.php:83
221
  msgid "View Guest Author"
222
  msgstr ""
223
 
224
+ #: php/class-coauthors-guest-authors.php:84
225
  msgid "Search Guest Authors"
226
  msgstr ""
227
 
228
+ #: php/class-coauthors-guest-authors.php:85
229
  msgid "No guest authors found"
230
  msgstr ""
231
 
232
+ #: php/class-coauthors-guest-authors.php:86
233
  msgid "No guest authors found in Trash"
234
  msgstr ""
235
 
236
+ #: php/class-coauthors-guest-authors.php:87
237
  msgid "Update Guest Author"
238
  msgstr ""
239
 
240
+ #: php/class-coauthors-guest-authors.php:88
241
  msgid "About the guest author"
242
  msgstr ""
243
 
244
+ #: php/class-coauthors-guest-authors.php:97
245
  msgctxt "co-authors-plus"
246
  msgid "Add New"
247
  msgstr ""
248
 
249
+ #: php/class-coauthors-guest-authors.php:153
250
+ #: php/class-coauthors-guest-authors.php:159
251
  msgid "Guest author updated. <a href=\"%s\">View profile</a>"
252
  msgstr ""
253
 
254
+ #: php/class-coauthors-guest-authors.php:154
255
  msgid "Custom field updated."
256
  msgstr ""
257
 
258
+ #: php/class-coauthors-guest-authors.php:155
259
  msgid "Custom field deleted."
260
  msgstr ""
261
 
262
+ #: php/class-coauthors-guest-authors.php:156
263
  msgid "Guest author updated."
264
  msgstr ""
265
 
266
  #. translators: %s: date and time of the revision
267
+ #: php/class-coauthors-guest-authors.php:158
268
  msgid "Guest author restored to revision from %s"
269
  msgstr ""
270
 
271
+ #: php/class-coauthors-guest-authors.php:160
272
  msgid "Guest author saved."
273
  msgstr ""
274
 
275
+ #: php/class-coauthors-guest-authors.php:161
276
  msgid ""
277
  "Guest author submitted. <a target=\"_blank\" href=\"%s\">Preview profile</a>"
278
  msgstr ""
279
 
280
+ #: php/class-coauthors-guest-authors.php:162
281
  msgid ""
282
  "Guest author scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
283
  "\"%2$s\">Preview profile</a>"
284
  msgstr ""
285
 
286
  #. translators: Publish box date format, see http:php.net/date
287
+ #: php/class-coauthors-guest-authors.php:164
288
  msgid "M j, Y @ G:i"
289
  msgstr ""
290
 
291
+ #: php/class-coauthors-guest-authors.php:165
292
  msgid ""
293
  "Guest author updated. <a target=\"_blank\" href=\"%s\">Preview profile</a>"
294
  msgstr ""
295
 
296
+ #: php/class-coauthors-guest-authors.php:182
297
+ #: php/class-coauthors-guest-authors.php:215
298
+ #: php/class-coauthors-guest-authors.php:430
299
  msgid "Doin' something fishy, huh?"
300
  msgstr ""
301
 
302
+ #: php/class-coauthors-guest-authors.php:185
303
+ #: php/class-coauthors-guest-authors.php:219
304
  msgid "You don't have permission to perform this action."
305
  msgstr ""
306
 
307
+ #: php/class-coauthors-guest-authors.php:224
308
+ #: php/class-coauthors-guest-authors.php:435
309
  msgid "Guest author can't be deleted because it doesn't exist."
310
  msgstr ""
311
 
312
+ #: php/class-coauthors-guest-authors.php:238
313
  msgid "Co-author does not exists. Try again?"
314
  msgstr ""
315
 
316
+ #: php/class-coauthors-guest-authors.php:246
317
  msgid "Please make sure to pick an option."
318
  msgstr ""
319
 
320
+ #: php/class-coauthors-guest-authors.php:386
321
  msgid "Guest author deleted."
322
  msgstr ""
323
 
324
+ #: php/class-coauthors-guest-authors.php:410
325
  msgid "Save"
326
  msgstr ""
327
 
328
+ #: php/class-coauthors-guest-authors.php:411
329
  msgid "Unique Slug"
330
  msgstr ""
331
 
332
+ #: php/class-coauthors-guest-authors.php:413
333
  msgid "Name"
334
  msgstr ""
335
 
336
+ #: php/class-coauthors-guest-authors.php:414
337
  msgid "Contact Info"
338
  msgstr ""
339
 
340
+ #: php/class-coauthors-guest-authors.php:439
341
  msgid "Delete %s"
342
  msgstr ""
343
 
344
+ #: php/class-coauthors-guest-authors.php:440
345
  msgid "You have specified this guest author for deletion:"
346
  msgstr ""
347
 
348
+ #: php/class-coauthors-guest-authors.php:442
349
  msgid "What should be done with posts assigned to this guest author?"
350
  msgstr ""
351
 
352
+ #: php/class-coauthors-guest-authors.php:443
353
  msgid ""
354
  "Note: If you'd like to delete the guest author and all of their posts, you "
355
  "should delete their posts first and then come back to delete the guest "
356
  "author."
357
  msgstr ""
358
 
359
+ #: php/class-coauthors-guest-authors.php:452
360
  msgid "Reassign to another co-author:"
361
  msgstr ""
362
 
363
+ #: php/class-coauthors-guest-authors.php:458
364
  msgid "Leave posts assigned to the mapped user, %s."
365
  msgstr ""
366
 
367
+ #: php/class-coauthors-guest-authors.php:463
368
  msgid "Remove byline from posts (but leave each post in its current status)."
369
  msgstr ""
370
 
371
+ #: php/class-coauthors-guest-authors.php:466
372
  msgid "Confirm Deletion"
373
  msgstr ""
374
 
375
+ #: php/class-coauthors-guest-authors.php:475
376
  msgid "Add New"
377
  msgstr ""
378
 
379
+ #: php/class-coauthors-guest-authors.php:536
380
  msgid "WordPress User Mapping"
381
  msgstr ""
382
 
383
+ #: php/class-coauthors-guest-authors.php:538
384
  msgid "-- Not mapped --"
385
  msgstr ""
386
 
387
+ #: php/class-coauthors-guest-authors.php:651
388
  msgid "Guest authors cannot be created without display names."
389
  msgstr ""
390
 
391
+ #: php/class-coauthors-guest-authors.php:658
392
  msgid ""
393
  "Guest authors cannot be created with the same user_login value as a user. "
394
  "Try creating a profile from the user instead"
395
  msgstr ""
396
 
397
+ #: php/class-coauthors-guest-authors.php:663
398
  msgid "Display name conflicts with another guest author display name."
399
  msgstr ""
400
 
401
+ #: php/class-coauthors-guest-authors.php:817
402
  msgid "ID"
403
  msgstr ""
404
 
405
+ #: php/class-coauthors-guest-authors.php:823
406
+ #: php/class-coauthors-wp-list-table.php:143
407
  msgid "Display Name"
408
  msgstr ""
409
 
410
+ #: php/class-coauthors-guest-authors.php:829
411
+ #: php/class-coauthors-wp-list-table.php:144
412
  msgid "First Name"
413
  msgstr ""
414
 
415
+ #: php/class-coauthors-guest-authors.php:834
416
+ #: php/class-coauthors-wp-list-table.php:145
417
  msgid "Last Name"
418
  msgstr ""
419
 
420
+ #: php/class-coauthors-guest-authors.php:839
421
  msgid "Slug"
422
  msgstr ""
423
 
424
+ #: php/class-coauthors-guest-authors.php:846
425
+ #: php/class-coauthors-wp-list-table.php:146
426
  msgid "E-mail"
427
  msgstr ""
428
 
429
+ #: php/class-coauthors-guest-authors.php:851
430
+ #: php/class-coauthors-wp-list-table.php:147
431
  msgid "Linked Account"
432
  msgstr ""
433
 
434
+ #: php/class-coauthors-guest-authors.php:856
435
  msgid "Website"
436
  msgstr ""
437
 
438
+ #: php/class-coauthors-guest-authors.php:861
439
  msgid "AIM"
440
  msgstr ""
441
 
442
+ #: php/class-coauthors-guest-authors.php:866
443
  msgid "Yahoo IM"
444
  msgstr ""
445
 
446
+ #: php/class-coauthors-guest-authors.php:871
447
  msgid "Jabber / Google Talk"
448
  msgstr ""
449
 
450
+ #: php/class-coauthors-guest-authors.php:876
451
  msgid "Biographical Info"
452
  msgstr ""
453
 
454
+ #: php/class-coauthors-guest-authors.php:1006
455
  msgid "%s is a required field"
456
  msgstr ""
457
 
458
+ #: php/class-coauthors-guest-authors.php:1012
459
  msgid "user_login cannot duplicate existing guest author or mapped user"
460
  msgstr ""
461
 
462
+ #: php/class-coauthors-guest-authors.php:1057
463
  msgid "Guest author does not exist"
464
  msgstr ""
465
 
466
+ #: php/class-coauthors-guest-authors.php:1069
467
  msgid "Reassignment co-author does not exist"
468
  msgstr ""
469
 
470
+ #: php/class-coauthors-guest-authors.php:1101
471
  msgid "No user exists with that ID"
472
  msgstr ""
473
 
474
+ #: php/class-coauthors-guest-authors.php:1158
475
  msgid "Edit Profile"
476
  msgstr ""
477
 
478
+ #: php/class-coauthors-guest-authors.php:1166
479
  msgid "Create Profile"
480
  msgstr ""
481
 
487
  msgid "Co-Author"
488
  msgstr ""
489
 
490
+ #: php/class-coauthors-wp-list-table.php:81
491
  msgid "Show all"
492
  msgstr ""
493
 
494
+ #: php/class-coauthors-wp-list-table.php:82
495
  msgid "With linked account"
496
  msgstr ""
497
 
498
+ #: php/class-coauthors-wp-list-table.php:83
499
  msgid "Without linked account"
500
  msgstr ""
501
 
502
+ #: php/class-coauthors-wp-list-table.php:135
503
  msgid "No matching guest authors were found."
504
  msgstr ""
505
 
506
+ #: php/class-coauthors-wp-list-table.php:206
507
  msgid "Delete"
508
  msgstr ""
509
 
510
+ #: php/class-coauthors-wp-list-table.php:207
511
  msgid "View Posts"
512
  msgstr ""
513
 
514
+ #: php/class-coauthors-wp-list-table.php:257
515
  msgid "Filter"
516
  msgstr ""
517
 
518
+ #: php/class-wp-cli.php:153
519
  msgid "Please specify a valid user_login"
520
  msgstr ""
521
 
522
+ #: php/class-wp-cli.php:156
523
  msgid "Please specify a valid co-author login"
524
  msgstr ""
525
 
526
+ #: php/class-wp-cli.php:163
527
  msgid "Skipping - Post #%d already has co-authors assigned: %s"
528
  msgstr ""
529
 
530
+ #: php/class-wp-cli.php:168
531
  msgid "Updating - Adding %s's byline to post #%d"
532
  msgstr ""
533
 
534
+ #: php/class-wp-cli.php:173
535
  msgid "All done! %d posts were affected."
536
  msgstr ""
537
 
538
+ #: template-tags.php:82
539
  msgid ""
540
  "No post ID provided for CoAuthorsIterator constructor. Are you not in a loop "
541
  "or is $post not set?"
542
  msgstr ""
543
 
544
+ #: template-tags.php:136
545
  msgid " and "
546
  msgstr ""
547
 
548
+ #: template-tags.php:208 template-tags.php:365
549
  msgid "Posts by %s"
550
  msgstr ""
551
 
552
+ #: template-tags.php:257
553
  msgid "Visit %s&#8217;s website"
554
  msgstr ""
555
 
php/class-coauthors-guest-authors.php CHANGED
@@ -64,7 +64,6 @@ class CoAuthors_Guest_Authors
64
  add_filter( 'user_row_actions', array( $this, 'filter_user_row_actions' ), 10, 2 );
65
 
66
  // Add support for featured thumbnails that we can use for guest author avatars
67
- add_action( 'after_setup_theme', array( $this, 'action_after_setup_theme' ) );
68
  add_filter( 'get_avatar', array( $this, 'filter_get_avatar' ),10 ,5 );
69
 
70
  // Allow users to change where this is placed in the WordPress admin
@@ -120,6 +119,18 @@ class CoAuthors_Guest_Authors
120
  );
121
  register_post_type( $this->post_type, $args );
122
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  // Hacky way to remove the title and the editor
124
  remove_post_type_support( $this->post_type, 'title' );
125
  remove_post_type_support( $this->post_type, 'editor' );
@@ -264,8 +275,12 @@ class CoAuthors_Guest_Authors
264
  die();
265
 
266
  $search = sanitize_text_field( $_GET['q'] );
 
 
 
 
267
 
268
- $results = wp_list_pluck( $coauthors_plus->search_authors( $search ), 'user_login' );
269
  $retval = array();
270
  foreach( $results as $user_login ) {
271
  $coauthor = $coauthors_plus->get_coauthor_by( 'user_login', $user_login );
@@ -334,9 +349,27 @@ class CoAuthors_Guest_Authors
334
 
335
  wp_enqueue_style( 'guest-authors-css', COAUTHORS_PLUS_URL . 'css/guest-authors.css', false, COAUTHORS_PLUS_VERSION );
336
  wp_enqueue_script( 'guest-authors-js', COAUTHORS_PLUS_URL . 'js/guest-authors.js', false, COAUTHORS_PLUS_VERSION );
 
 
337
  }
338
  }
339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  /**
341
  * Show some extra notices to the user
342
  *
@@ -412,7 +445,7 @@ class CoAuthors_Guest_Authors
412
  // Hidden stuffs
413
  echo '<input type="hidden" name="action" value="delete-guest-author" />';
414
  wp_nonce_field( 'delete-guest-author' );
415
- echo '<input type="hidden" name="id" value="' . esc_attr( (int)$_GET['id'] ) . '" />';
416
  echo '<fieldset><ul style="list-style-type:none;">';
417
  // Reassign to another user
418
  echo '<li class="hide-if-no-js"><label for="reassign-another">';
@@ -724,6 +757,7 @@ class CoAuthors_Guest_Authors
724
  case 'login':
725
  case 'user_login':
726
  case 'linked_account':
 
727
  if ( 'login' == $key )
728
  $key = 'user_login';
729
  // Ensure we aren't doing the lookup by the prefixed value
@@ -1135,27 +1169,6 @@ class CoAuthors_Guest_Authors
1135
  return $new_actions + $actions;
1136
  }
1137
 
1138
- /**
1139
- * Anything to do after the theme has been set up
1140
- *
1141
- * @since 3.0
1142
- */
1143
- function action_after_setup_theme() {
1144
- add_theme_support( 'post-thumbnails', array( $this->post_type ) );
1145
-
1146
- // Some of the common sizes used by get_avatar
1147
- $this->avatar_sizes = array(
1148
- 32,
1149
- 64,
1150
- 96,
1151
- 128
1152
- );
1153
- $this->avatar_sizes = apply_filters( 'coauthors_guest_author_avatar_sizes', $this->avatar_sizes );
1154
- foreach( $this->avatar_sizes as $size ) {
1155
- add_image_size( 'guest-author-' . $size, $size, $size, true );
1156
- }
1157
- }
1158
-
1159
  /**
1160
  * Filter 'get_avatar' to replace with our own avatar if one exists
1161
  *
64
  add_filter( 'user_row_actions', array( $this, 'filter_user_row_actions' ), 10, 2 );
65
 
66
  // Add support for featured thumbnails that we can use for guest author avatars
 
67
  add_filter( 'get_avatar', array( $this, 'filter_get_avatar' ),10 ,5 );
68
 
69
  // Allow users to change where this is placed in the WordPress admin
119
  );
120
  register_post_type( $this->post_type, $args );
121
 
122
+ // Some of the common sizes used by get_avatar
123
+ $this->avatar_sizes = array(
124
+ 32,
125
+ 64,
126
+ 96,
127
+ 128
128
+ );
129
+ $this->avatar_sizes = apply_filters( 'coauthors_guest_author_avatar_sizes', $this->avatar_sizes );
130
+ foreach( $this->avatar_sizes as $size ) {
131
+ add_image_size( 'guest-author-' . $size, $size, $size, true );
132
+ }
133
+
134
  // Hacky way to remove the title and the editor
135
  remove_post_type_support( $this->post_type, 'title' );
136
  remove_post_type_support( $this->post_type, 'editor' );
275
  die();
276
 
277
  $search = sanitize_text_field( $_GET['q'] );
278
+ if ( ! empty( $_GET['guest_author'] ) )
279
+ $ignore = array( $this->get_guest_author_by( 'ID', (int)$_GET['guest_author'] )->user_login );
280
+ else
281
+ $ignore = array();
282
 
283
+ $results = wp_list_pluck( $coauthors_plus->search_authors( $search, $ignore ), 'user_login' );
284
  $retval = array();
285
  foreach( $results as $user_login ) {
286
  $coauthor = $coauthors_plus->get_coauthor_by( 'user_login', $user_login );
349
 
350
  wp_enqueue_style( 'guest-authors-css', COAUTHORS_PLUS_URL . 'css/guest-authors.css', false, COAUTHORS_PLUS_VERSION );
351
  wp_enqueue_script( 'guest-authors-js', COAUTHORS_PLUS_URL . 'js/guest-authors.js', false, COAUTHORS_PLUS_VERSION );
352
+ } else if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) && $this->post_type == get_post_type() ) {
353
+ add_action( 'admin_head', array( $this, 'change_title_icon' ) );
354
  }
355
  }
356
 
357
+ /**
358
+ * Change the icon appearing next to the title
359
+ * Core doesn't allow us to filter screen_icon(), so changing the ID is the next best thing
360
+ *
361
+ * @since 3.0.1
362
+ */
363
+ function change_title_icon() {
364
+ ?>
365
+ <script type="text/javascript">
366
+ jQuery(document).ready(function($){
367
+ $('#icon-edit').attr('id', 'icon-users');
368
+ });
369
+ </script>
370
+ <?php
371
+ }
372
+
373
  /**
374
  * Show some extra notices to the user
375
  *
445
  // Hidden stuffs
446
  echo '<input type="hidden" name="action" value="delete-guest-author" />';
447
  wp_nonce_field( 'delete-guest-author' );
448
+ echo '<input type="hidden" id="id" name="id" value="' . esc_attr( (int)$_GET['id'] ) . '" />';
449
  echo '<fieldset><ul style="list-style-type:none;">';
450
  // Reassign to another user
451
  echo '<li class="hide-if-no-js"><label for="reassign-another">';
757
  case 'login':
758
  case 'user_login':
759
  case 'linked_account':
760
+ case 'user_email':
761
  if ( 'login' == $key )
762
  $key = 'user_login';
763
  // Ensure we aren't doing the lookup by the prefixed value
1169
  return $new_actions + $actions;
1170
  }
1171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1172
  /**
1173
  * Filter 'get_avatar' to replace with our own avatar if one exists
1174
  *
php/class-coauthors-wp-list-table.php CHANGED
@@ -34,6 +34,19 @@ class CoAuthors_WP_List_Table extends WP_List_Table {
34
  'first_name' => array( 'first_name', 'ASC' ),
35
  'last_name' => array( 'last_name', 'ASC' ),
36
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  $this->_column_headers = array( $columns, $hidden, $sortable );
38
 
39
  $paged = ( isset( $_REQUEST['paged'] ) ) ? intval( $_REQUEST['paged'] ) : 1;
@@ -94,7 +107,7 @@ class CoAuthors_WP_List_Table extends WP_List_Table {
94
  $author_posts = new WP_Query( $args );
95
  $items = array();
96
  foreach( $author_posts->get_posts() as $author_post ) {
97
- $items[] = $coauthors_plus->guest_authors->get_guest_author_by( 'id', $author_post->ID );
98
  }
99
 
100
  if( $this->is_search )
@@ -134,6 +147,8 @@ class CoAuthors_WP_List_Table extends WP_List_Table {
134
  'linked_account' => __( 'Linked Account', 'co-authors-plus' ),
135
  'posts' => __( 'Posts', 'co-authors-plus' ),
136
  );
 
 
137
  return $columns;
138
  }
139
 
@@ -161,6 +176,10 @@ class CoAuthors_WP_List_Table extends WP_List_Table {
161
  return $item->$column_name;
162
  case 'user_email':
163
  return '<a href="' . esc_attr( 'mailto:' . $item->user_email ) . '">' . esc_html( $item->user_email ) . '</a>';
 
 
 
 
164
  }
165
  }
166
 
@@ -214,9 +233,11 @@ class CoAuthors_WP_List_Table extends WP_List_Table {
214
  function column_posts( $item ) {
215
  global $coauthors_plus;
216
  $term = $coauthors_plus->get_author_term( $item );
217
- if ( ! $term )
218
- return '';
219
- return '<a href="' . esc_url( add_query_arg( 'author_name', $item->user_login, admin_url( 'edit.php' ) ) ) . '">' . $term->count . '</a>';
 
 
220
  }
221
 
222
  /**
34
  'first_name' => array( 'first_name', 'ASC' ),
35
  'last_name' => array( 'last_name', 'ASC' ),
36
  );
37
+ $_sortable = apply_filters( "coauthors_guest_author_sortable_columns", $this->get_sortable_columns() );
38
+
39
+ foreach( (array)$_sortable as $id => $data ) {
40
+ if ( empty( $data ) )
41
+ continue;
42
+
43
+ $data = (array) $data;
44
+ if ( !isset( $data[1] ) )
45
+ $data[1] = false;
46
+
47
+ $sortable[$id] = $data;
48
+ }
49
+
50
  $this->_column_headers = array( $columns, $hidden, $sortable );
51
 
52
  $paged = ( isset( $_REQUEST['paged'] ) ) ? intval( $_REQUEST['paged'] ) : 1;
107
  $author_posts = new WP_Query( $args );
108
  $items = array();
109
  foreach( $author_posts->get_posts() as $author_post ) {
110
+ $items[] = $coauthors_plus->guest_authors->get_guest_author_by( 'ID', $author_post->ID );
111
  }
112
 
113
  if( $this->is_search )
147
  'linked_account' => __( 'Linked Account', 'co-authors-plus' ),
148
  'posts' => __( 'Posts', 'co-authors-plus' ),
149
  );
150
+
151
+ $columns = apply_filters( "coauthors_guest_author_manage_columns", $columns );
152
  return $columns;
153
  }
154
 
176
  return $item->$column_name;
177
  case 'user_email':
178
  return '<a href="' . esc_attr( 'mailto:' . $item->user_email ) . '">' . esc_html( $item->user_email ) . '</a>';
179
+
180
+ default:
181
+ do_action( "coauthors_guest_author_custom_columns", $column_name, $item->ID );
182
+ break;
183
  }
184
  }
185
 
233
  function column_posts( $item ) {
234
  global $coauthors_plus;
235
  $term = $coauthors_plus->get_author_term( $item );
236
+ if ( $term )
237
+ $count = $term->count;
238
+ else
239
+ $count = 0;
240
+ return '<a href="' . esc_url( add_query_arg( 'author_name', $item->user_login, admin_url( 'edit.php' ) ) ) . '">' . $count . '</a>';
241
  }
242
 
243
  /**
php/class-wp-cli.php CHANGED
@@ -243,12 +243,12 @@ class CoAuthorsPlus_Command extends WP_CLI_Command {
243
  // Otherwise, simply rename the old term
244
  $new_term = $coauthors_plus->get_author_term( $coauthors_plus->get_coauthor_by( 'login', $new_user ) );
245
  if ( is_object( $new_term ) ) {
 
246
  $args = array(
247
  'default' => $new_term->term_id,
248
  'force_default' => true,
249
  );
250
  wp_delete_term( $old_term->term_id, $coauthors_plus->coauthor_taxonomy, $args );
251
- WP_CLI::line( "Success: There's already a '{$new_user}' term for '{$old_user}'. Reassigning posts and then deleting the term" );
252
  $results->new_term_exists++;
253
  } else {
254
  $args = array(
@@ -269,6 +269,58 @@ class CoAuthorsPlus_Command extends WP_CLI_Command {
269
 
270
  }
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  /**
273
  * List all of the posts without assigned co-authors terms
274
  *
@@ -380,6 +432,33 @@ class CoAuthorsPlus_Command extends WP_CLI_Command {
380
  WP_CLI::success( "All done" );
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  /**
384
  * Clear all of the caches for memory management
385
  */
243
  // Otherwise, simply rename the old term
244
  $new_term = $coauthors_plus->get_author_term( $coauthors_plus->get_coauthor_by( 'login', $new_user ) );
245
  if ( is_object( $new_term ) ) {
246
+ WP_CLI::line( "Success: There's already a '{$new_user}' term for '{$old_user}'. Reassigning {$old_term->count} posts and then deleting the term" );
247
  $args = array(
248
  'default' => $new_term->term_id,
249
  'force_default' => true,
250
  );
251
  wp_delete_term( $old_term->term_id, $coauthors_plus->coauthor_taxonomy, $args );
 
252
  $results->new_term_exists++;
253
  } else {
254
  $args = array(
269
 
270
  }
271
 
272
+ /**
273
+ * Change a term from representing one user_login value to another
274
+ * If the term represents a guest author, the post_name will be changed
275
+ * in addition to the term slug/name
276
+ *
277
+ * @since 3.0.1
278
+ *
279
+ * @subcommand rename-coauthor
280
+ * @synopsis --from=<user-login> --to=<user-login>
281
+ */
282
+ public function rename_coauthor( $args, $assoc_args ) {
283
+ global $coauthors_plus, $wpdb;
284
+
285
+ $defaults = array(
286
+ 'from' => null,
287
+ 'to' => null,
288
+ );
289
+ $assoc_args = array_merge( $defaults, $assoc_args );
290
+
291
+ $to_userlogin = $assoc_args['to'];
292
+ $to_userlogin_prefixed = 'cap-' . $to_userlogin;
293
+
294
+ $orig_coauthor = $coauthors_plus->get_coauthor_by( 'user_login', $assoc_args['from'] );
295
+ if ( ! $orig_coauthor )
296
+ WP_CLI::error( "No co-author found for {$assoc_args['from']}" );
297
+
298
+ if ( ! $to_userlogin )
299
+ WP_CLI::error( '--to param must not be empty' );
300
+
301
+ if ( $coauthors_plus->get_coauthor_by( 'user_login', $to_userlogin ) )
302
+ WP_CLI::error( "New user_login value conflicts with existing co-author" );
303
+
304
+ $orig_term = $coauthors_plus->get_author_term( $orig_coauthor );
305
+
306
+ WP_CLI::line( "Renaming {$orig_term->name} to {$to_userlogin}" );
307
+ $rename_args = array(
308
+ 'name' => $to_userlogin,
309
+ 'slug' => $to_userlogin_prefixed,
310
+ );
311
+ wp_update_term( $orig_term->term_id, $coauthors_plus->coauthor_taxonomy, $rename_args );
312
+
313
+ if ( 'guest-author' == $orig_coauthor->type ) {
314
+ $wpdb->update( $wpdb->posts, array( 'post_name' => $to_userlogin_prefixed ), array( 'ID' => $orig_coauthor->ID ) );
315
+ clean_post_cache( $orig_coauthor->ID );
316
+ update_post_meta( $orig_coauthor->ID, 'cap-user_login', $to_userlogin );
317
+ $coauthors_plus->guest_authors->delete_guest_author_cache( $orig_coauthor->ID );
318
+ WP_CLI::line( "Updated guest author profile value too" );
319
+ }
320
+
321
+ WP_CLI::success( "All done!" );
322
+ }
323
+
324
  /**
325
  * List all of the posts without assigned co-authors terms
326
  *
432
  WP_CLI::success( "All done" );
433
  }
434
 
435
+ /**
436
+ * Remove author terms from revisions, which we've been adding since the dawn of time
437
+ *
438
+ * @since 3.0.1
439
+ *
440
+ * @subcommand remove-terms-from-revisions
441
+ */
442
+ public function remove_terms_from_revisions() {
443
+ global $wpdb;
444
+
445
+ $ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='revision' AND post_status='inherit'" );
446
+
447
+ WP_CLI::line( "Found " . count( $ids ) . " revisions to look through" );
448
+ $affected = 0;
449
+ foreach( $ids as $post_id ) {
450
+
451
+ $terms = wp_get_post_terms( $post_id, 'author' );
452
+ if ( ! $terms )
453
+ continue;
454
+
455
+ WP_CLI::line( "#{$post_id}: Removing " . implode( ',', wp_list_pluck( $terms, 'slug' ) ) );
456
+ wp_set_post_terms( $post_id, array(), 'author' );
457
+ $affected++;
458
+ }
459
+ WP_CLI::line( "All done! {$affected} revisions had author terms removed" );
460
+ }
461
+
462
  /**
463
  * Clear all of the caches for memory management
464
  */
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: batmoo, danielbachhuber, automattic
3
  Tags: authors, users, multiple authors, coauthors, multi-author, publishing
4
  Tested up to: 3.4.2
5
  Requires at least: 3.3
6
- Stable tag: 3.0
7
 
8
  Assign multiple bylines to posts, pages, and custom post types via a search-as-you-type input box
9
 
@@ -27,8 +27,22 @@ If you've just installed Co-Authors Plus, you might notice that the bylines are
27
 
28
  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.
29
 
 
 
 
 
 
30
  == Changelog ==
31
 
 
 
 
 
 
 
 
 
 
32
  = 3.0 (Nov. 12, 2012) =
33
  * Create guest author profiles for bylines you'd like to assign without creating WordPress user accounts. Guest authors can have all of the same fields as normal users including display name, biography, and avatars.
34
  * Support for non-Latin characters in usernames and guest author names
3
  Tags: authors, users, multiple authors, coauthors, multi-author, publishing
4
  Tested up to: 3.4.2
5
  Requires at least: 3.3
6
+ Stable tag: 3.0.1
7
 
8
  Assign multiple bylines to posts, pages, and custom post types via a search-as-you-type input box
9
 
27
 
28
  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.
29
 
30
+ == Upgrade Notice ==
31
+
32
+ = 3.0.1 =
33
+ Bug fixes and minor enhancements
34
+
35
  == Changelog ==
36
 
37
+ = 3.0.1 (Nov. 21, 2012) =
38
+ * Add your own custom columns to the guest authors table using filters. Props [cfg](https://github.com/cfg)
39
+ * A new wp-cli subcommand for renaming co-authors and another for removing author terms mistakenly assigned to revisions
40
+ * Bug fix: Using a featured image for a guest author avatar didn't work. Now it does.
41
+ * Bug fix: Don't assign author terms to revisions to avoid unnecessary database bloat
42
+ * Bug fix: Make the coauthors_wp_list_authors() template tag work again
43
+ * Bug fix: Improve capability filtering by properly handling super admin access and situations where user_id = 0
44
+ * Minor UI enhancements for guest authors
45
+
46
  = 3.0 (Nov. 12, 2012) =
47
  * Create guest author profiles for bylines you'd like to assign without creating WordPress user accounts. Guest authors can have all of the same fields as normal users including display name, biography, and avatars.
48
  * Support for non-Latin characters in usernames and guest author names
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
template-tags.php CHANGED
@@ -14,7 +14,7 @@ function get_coauthors( $post_id = 0, $args = array() ) {
14
  $args = wp_parse_args( $args, $defaults );
15
 
16
  if ( $post_id ) {
17
- $coauthor_terms = wp_get_post_terms( $post_id, $coauthors_plus->coauthor_taxonomy, $args );
18
 
19
  if ( is_array( $coauthor_terms ) && !empty( $coauthor_terms ) ) {
20
  foreach( $coauthor_terms as $coauthor ) {
@@ -49,6 +49,9 @@ function is_coauthor_for_post( $user, $post_id = 0 ) {
49
  $post_id = $post->ID;
50
  if( ! $post_id )
51
  return false;
 
 
 
52
 
53
  $coauthors = get_coauthors( $post_id );
54
  if ( is_numeric( $user ) ) {
@@ -288,7 +291,6 @@ function the_coauthor_meta( $field, $user_id = 0 ) {
288
  /**
289
  * List all the *co-authors* of the blog, with several options available.
290
  * optioncount (boolean) (false): Show the count in parenthesis next to the author's name.
291
- * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default.
292
  * show_fullname (boolean) (false): Show their full names.
293
  * hide_empty (boolean) (true): Don't show authors without any posts.
294
  * feed (string) (''): If isn't empty, show links to author's feeds.
@@ -296,46 +298,56 @@ function the_coauthor_meta( $field, $user_id = 0 ) {
296
  * echo (boolean) (true): Set to false to return the output, instead of echoing.
297
  * @param array $args The argument array.
298
  * @return null|string The output, if echo is set to false.
299
- *
300
- * NOTE: This is not perfect and probably won't work that well.
301
- *
302
  */
303
-
304
- function coauthors_wp_list_authors($args = '') {
305
- global $wpdb, $coauthors_plus;
306
 
307
  $defaults = array(
308
- 'optioncount' => false, 'exclude_admin' => true,
309
- 'show_fullname' => false, 'hide_empty' => true,
310
- 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
311
- 'style' => 'list', 'html' => true
 
 
 
 
 
 
312
  );
313
 
314
- $r = wp_parse_args( $args, $defaults );
315
- extract($r, EXTR_SKIP);
316
  $return = '';
317
 
318
- $authors = $coauthors_plus->search_authors();
319
- $author_terms = get_terms( 'author' );
 
 
 
 
 
 
 
 
 
 
 
320
 
321
- foreach ( (array) $author_terms as $author_term ) {
322
- $author_count[$author_term->slug] = $author_term->count;
323
  }
324
 
325
  foreach ( (array) $authors as $author ) {
326
 
327
  $link = '';
328
 
329
- $author = get_userdata( $author->ID );
330
- $posts = (isset($author_count[$author->user_login])) ? $author_count[$author->user_login] : 0;
331
- $name = $author->display_name;
332
-
333
- if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') )
334
  $name = "$author->first_name $author->last_name";
 
 
 
335
 
336
- if( !$html ) {
337
- if ( $posts == 0 ) {
338
- if ( ! $hide_empty )
339
  $return .= $name . ', ';
340
  } else
341
  $return .= $name . ', ';
@@ -344,54 +356,54 @@ function coauthors_wp_list_authors($args = '') {
344
  continue;
345
  }
346
 
347
- if ( !($posts == 0 && $hide_empty) && 'list' == $style )
348
  $return .= '<li>';
349
- if ( $posts == 0 ) {
350
- if ( ! $hide_empty )
351
  $link = $name;
352
  } else {
353
- $link = '<a href="' . get_author_posts_url($author->ID, $author->user_nicename) . '" title="' . esc_attr( sprintf(__("Posts by %s", 'co-authors-plus'), $author->display_name) ) . '">' . $name . '</a>';
354
 
355
- if ( (! empty($feed_image)) || (! empty($feed)) ) {
356
  $link .= ' ';
357
- if (empty($feed_image))
358
  $link .= '(';
359
- $link .= '<a href="' . get_author_feed_link($author->ID) . '"';
360
 
361
- if ( !empty($feed) ) {
362
- $title = ' title="' . esc_attr($feed) . '"';
363
- $alt = ' alt="' . esc_attr($feed) . '"';
364
  $name = $feed;
365
  $link .= $title;
366
  }
367
 
368
  $link .= '>';
369
 
370
- if ( !empty($feed_image) )
371
- $link .= "<img src=\"" . esc_url($feed_image) . "\" style=\"border: none;\"$alt$title" . ' />';
372
  else
373
  $link .= $name;
374
 
375
  $link .= '</a>';
376
 
377
- if ( empty($feed_image) )
378
  $link .= ')';
379
  }
380
 
381
- if ( $optioncount )
382
- $link .= ' ('. $posts . ')';
383
 
384
  }
385
 
386
- if ( !($posts == 0 && $hide_empty) && 'list' == $style )
387
  $return .= $link . '</li>';
388
- else if ( ! $hide_empty )
389
  $return .= $link . ', ';
390
  }
391
 
392
- $return = trim($return, ', ');
393
 
394
- if ( ! $echo )
395
  return $return;
396
  echo $return;
397
  }
14
  $args = wp_parse_args( $args, $defaults );
15
 
16
  if ( $post_id ) {
17
+ $coauthor_terms = get_the_terms( $post_id, $coauthors_plus->coauthor_taxonomy, $args );
18
 
19
  if ( is_array( $coauthor_terms ) && !empty( $coauthor_terms ) ) {
20
  foreach( $coauthor_terms as $coauthor ) {
49
  $post_id = $post->ID;
50
  if( ! $post_id )
51
  return false;
52
+
53
+ if ( ! $user )
54
+ return false;
55
 
56
  $coauthors = get_coauthors( $post_id );
57
  if ( is_numeric( $user ) ) {
291
  /**
292
  * List all the *co-authors* of the blog, with several options available.
293
  * optioncount (boolean) (false): Show the count in parenthesis next to the author's name.
 
294
  * show_fullname (boolean) (false): Show their full names.
295
  * hide_empty (boolean) (true): Don't show authors without any posts.
296
  * feed (string) (''): If isn't empty, show links to author's feeds.
298
  * echo (boolean) (true): Set to false to return the output, instead of echoing.
299
  * @param array $args The argument array.
300
  * @return null|string The output, if echo is set to false.
 
 
 
301
  */
302
+ function coauthors_wp_list_authors( $args = array() ) {
303
+ global $coauthors_plus;
 
304
 
305
  $defaults = array(
306
+ 'optioncount' => false,
307
+ 'show_fullname' => false,
308
+ 'hide_empty' => true,
309
+ 'feed' => '',
310
+ 'feed_image' => '',
311
+ 'feed_type' => '',
312
+ 'echo' => true,
313
+ 'style' => 'list',
314
+ 'html' => true,
315
+ 'number' => 20, // A sane limit to start to avoid breaking all the things
316
  );
317
 
318
+ $args = wp_parse_args( $args, $defaults );
 
319
  $return = '';
320
 
321
+ $term_args = array(
322
+ 'orderby' => 'name',
323
+ 'hide_empty' => 0,
324
+ 'number' => (int)$args['number'],
325
+ );
326
+ $author_terms = get_terms( $coauthors_plus->coauthor_taxonomy, $term_args );
327
+ $authors = array();
328
+ foreach( $author_terms as $author_term ) {
329
+ // Something's wrong in the state of Denmark
330
+ if ( false === ( $coauthor = $coauthors_plus->get_coauthor_by( 'user_login', $author_term->name ) ) )
331
+ continue;
332
+
333
+ $authors[$author_term->name] = $coauthor;
334
 
335
+ $authors[$author_term->name]->post_count = $author_term->count;
 
336
  }
337
 
338
  foreach ( (array) $authors as $author ) {
339
 
340
  $link = '';
341
 
342
+ if ( $args['show_fullname'] && ( $author->first_name && $author->last_name ) )
 
 
 
 
343
  $name = "$author->first_name $author->last_name";
344
+ else
345
+ $name = $author->display_name;
346
+
347
 
348
+ if ( ! $args['html'] ) {
349
+ if ( $author->post_count == 0 ) {
350
+ if ( ! $args['hide_empty'] )
351
  $return .= $name . ', ';
352
  } else
353
  $return .= $name . ', ';
356
  continue;
357
  }
358
 
359
+ if ( ! ( $author->post_count == 0 && $args['hide_empty'] ) && 'list' == $args['style'] )
360
  $return .= '<li>';
361
+ if ( $author->post_count == 0 ) {
362
+ if ( ! $args['hide_empty'] )
363
  $link = $name;
364
  } else {
365
+ $link = '<a href="' . get_author_posts_url( $author->ID, $author->user_nicename ) . '" title="' . esc_attr( sprintf( __("Posts by %s", 'co-authors-plus' ), $name ) ) . '">' . esc_html( $name ) . '</a>';
366
 
367
+ if ( (! empty( $args['feed_image'] ) ) || ( ! empty( $args['feed'] ) ) ) {
368
  $link .= ' ';
369
+ if ( empty( $args['feed_image'] ) )
370
  $link .= '(';
371
+ $link .= '<a href="' . get_author_feed_link( $author->ID ) . '"';
372
 
373
+ if ( !empty( $args['feed'] ) ) {
374
+ $title = ' title="' . esc_attr( $args['feed'] ) . '"';
375
+ $alt = ' alt="' . esc_attr( $args['feed'] ) . '"';
376
  $name = $feed;
377
  $link .= $title;
378
  }
379
 
380
  $link .= '>';
381
 
382
+ if ( ! empty( $args['feed_image'] ) )
383
+ $link .= "<img src=\"" . esc_url( $args['feed_image'] ) . "\" style=\"border: none;\"$alt$title" . ' />';
384
  else
385
  $link .= $name;
386
 
387
  $link .= '</a>';
388
 
389
+ if ( empty( $args['feed_image'] ) )
390
  $link .= ')';
391
  }
392
 
393
+ if ( $args['optioncount'] )
394
+ $link .= ' ('. $author->post_count . ')';
395
 
396
  }
397
 
398
+ if ( ! ( $author->post_count == 0 && $args['hide_empty'] ) && 'list' == $args['style'] )
399
  $return .= $link . '</li>';
400
+ else if ( ! $args['hide_empty'] )
401
  $return .= $link . ', ';
402
  }
403
 
404
+ $return = trim( $return, ', ' );
405
 
406
+ if ( ! $args['echo'] )
407
  return $return;
408
  echo $return;
409
  }