Permalink
Browse files

Pull 67 (#67) was incomplete. Contains wp-admin fixes to complete the…

… move to user_nicename.
  • Loading branch information...
STRML committed Nov 29, 2012
1 parent 56defa3 commit ec2f594ce426e7712ca43949e3f84db6d9d4fcb8
Showing with 7 additions and 3 deletions.
  1. +2 −1 co-authors-plus.php
  2. +5 −2 js/co-authors-plus.js
View
@@ -333,6 +333,7 @@ function coauthors_meta_box( $post ) {
<input type="text" name="coauthorsinput[]" readonly="readonly" value="<?php echo esc_attr( $coauthor->display_name ); ?>" />
<input type="text" name="coauthors[]" value="<?php echo esc_attr( $coauthor->user_login ); ?>" />
<input type="text" name="coauthorsemails[]" value="<?php echo esc_attr( $coauthor->user_email ); ?>" />
+ <input type="text" name="coauthorsnicenames[]" value="<?php echo esc_attr( $coauthor->user_nicename ); ?>" />
</span>
</li>
<?php
@@ -844,7 +845,7 @@ function ajax_suggest() {
$authors = $this->search_authors( $search, $ignore );
foreach( $authors as $author ) {
- echo $author->ID ." | ". $author->user_login ." | ". $author->display_name ." | ". $author->user_email ."\n";
+ echo $author->ID ." | ". $author->user_login ." | ". $author->display_name ." | ". $author->user_email ." | ". $author->user_nicename . "\n";
}
die();
View
@@ -52,7 +52,7 @@ jQuery(document).ready(function () {
;
// Update the value of the hidden input
- co.siblings('input[name="coauthors[]"]').val(author.login);
+ co.siblings('input[name="coauthors[]"]').val(author.nicename);
}
@@ -215,6 +215,7 @@ jQuery(document).ready(function () {
author.login = jQuery.trim(vals[1]);
author.name = jQuery.trim(vals[2]);
author.email = jQuery.trim(vals[3]);
+ author.nicename = jQuery.trim(vals[4]);
if(author.id=="New") {
//alert('Eventually, this will allow you to add a new author right from here. But it\'s not ready yet. *sigh*');
@@ -304,7 +305,7 @@ jQuery(document).ready(function () {
'type': 'hidden',
'id': 'coauthors_hidden_input',
'name': 'coauthors[]',
- 'value': unescape(author.login)
+ 'value': unescape(author.nicename)
})
;
@@ -392,6 +393,7 @@ jQuery(document).ready(function () {
var $post_coauthor_logins = jQuery('input[name="coauthors[]"]');
var $post_coauthor_names = jQuery('input[name="coauthorsinput[]"]');
var $post_coauthor_emails = jQuery('input[name="coauthorsemails[]"]');
+ var $post_coauthor_nicenames = jQuery('input[name="coauthorsnicenames[]"]');
post_coauthors = [];
@@ -400,6 +402,7 @@ jQuery(document).ready(function () {
login: $post_coauthor_logins[i].value,
name: $post_coauthor_names[i].value,
email: $post_coauthor_emails[i].value,
+ nicename: $post_coauthor_nicenames[i].value
});
}

0 comments on commit ec2f594

Please sign in to comment.