Version Description
(Feb. 18, 2013) = * New filter 'coauthors_search_authors_get_terms_args' allows you to increase the number of matches returned with AJAX co-author selection * Bug fix: If there isn't an author term yet for a co-author, avoid an erronous join that caused duplicate posts to appear.
Download this release
Release Info
| Developer | danielbachhuber |
| Plugin | |
| Version | 3.0.5 |
| Comparing to | |
| See all releases | |
Code changes from version 3.0.4 to 3.0.5
- co-authors-plus.php +7 -3
- php/class-wp-cli.php +67 -0
- readme.txt +15 -1
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- template-tags.php +84 -1
co-authors-plus.php
CHANGED
|
@@ -3,9 +3,9 @@
|
|
| 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-
|
| 9 |
|
| 10 |
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
|
| 11 |
This program is free software; you can redistribute it and/or modify
|
|
@@ -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__ ) );
|
|
@@ -512,6 +512,9 @@ class coauthors_plus {
|
|
| 512 |
if ( !empty( $query->query_vars['post_type'] ) && !is_object_in_taxonomy( $query->query_vars['post_type'], $this->coauthor_taxonomy ) )
|
| 513 |
return $join;
|
| 514 |
|
|
|
|
|
|
|
|
|
|
| 515 |
// Check to see that JOIN hasn't already been added. Props michaelingp and nbaxley
|
| 516 |
$term_relationship_join = " INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
|
| 517 |
$term_taxonomy_join = " INNER JOIN {$wpdb->term_taxonomy} ON ( {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id )";
|
|
@@ -889,6 +892,7 @@ class coauthors_plus {
|
|
| 889 |
'get' => 'all',
|
| 890 |
'number' => 10,
|
| 891 |
);
|
|
|
|
| 892 |
add_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) );
|
| 893 |
$found_terms = get_terms( $this->coauthor_taxonomy, $args );
|
| 894 |
remove_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) );
|
| 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.5
|
| 7 |
Author: Mohammad Jangda, Daniel Bachhuber, Automattic
|
| 8 |
+
Copyright: 2008-2013 Shared and distributed between Mohammad Jangda, Daniel Bachhuber, Weston Ruter
|
| 9 |
|
| 10 |
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
|
| 11 |
This program is free software; you can redistribute it and/or modify
|
| 24 |
|
| 25 |
*/
|
| 26 |
|
| 27 |
+
define( 'COAUTHORS_PLUS_VERSION', '3.0.5' );
|
| 28 |
|
| 29 |
define( 'COAUTHORS_PLUS_PATH', dirname( __FILE__ ) );
|
| 30 |
define( 'COAUTHORS_PLUS_URL', plugin_dir_url( __FILE__ ) );
|
| 512 |
if ( !empty( $query->query_vars['post_type'] ) && !is_object_in_taxonomy( $query->query_vars['post_type'], $this->coauthor_taxonomy ) )
|
| 513 |
return $join;
|
| 514 |
|
| 515 |
+
if ( empty( $this->having_terms ) )
|
| 516 |
+
return $join;
|
| 517 |
+
|
| 518 |
// Check to see that JOIN hasn't already been added. Props michaelingp and nbaxley
|
| 519 |
$term_relationship_join = " INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
|
| 520 |
$term_taxonomy_join = " INNER JOIN {$wpdb->term_taxonomy} ON ( {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id )";
|
| 892 |
'get' => 'all',
|
| 893 |
'number' => 10,
|
| 894 |
);
|
| 895 |
+
$args = apply_filters( 'coauthors_search_authors_get_terms_args', $args );
|
| 896 |
add_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) );
|
| 897 |
$found_terms = get_terms( $this->coauthor_taxonomy, $args );
|
| 898 |
remove_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) );
|
php/class-wp-cli.php
CHANGED
|
@@ -44,6 +44,73 @@ class CoAuthorsPlus_Command extends WP_CLI_Command {
|
|
| 44 |
|
| 45 |
}
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
/**
|
| 48 |
* Subcommand to assign coauthors to a post based on a given meta key
|
| 49 |
*
|
| 44 |
|
| 45 |
}
|
| 46 |
|
| 47 |
+
/**
|
| 48 |
+
* Create author terms for all posts that don't have them
|
| 49 |
+
*
|
| 50 |
+
* @subcommand create-terms-for-posts
|
| 51 |
+
*/
|
| 52 |
+
public function create_terms_for_posts() {
|
| 53 |
+
global $coauthors_plus, $wp_post_types;
|
| 54 |
+
|
| 55 |
+
// Cache these to prevent repeated lookups
|
| 56 |
+
$authors = array();
|
| 57 |
+
$author_terms = array();
|
| 58 |
+
|
| 59 |
+
$args = array(
|
| 60 |
+
'order' => 'ASC',
|
| 61 |
+
'orderby' => 'ID',
|
| 62 |
+
'post_type' => $coauthors_plus->supported_post_types,
|
| 63 |
+
'posts_per_page' => 100,
|
| 64 |
+
'paged' => 1,
|
| 65 |
+
'update_meta_cache' => false,
|
| 66 |
+
);
|
| 67 |
+
|
| 68 |
+
$posts = new WP_Query( $args );
|
| 69 |
+
$affected = 0;
|
| 70 |
+
$count = 0;
|
| 71 |
+
WP_CLI::line( "Now inspecting or updating {$posts->found_posts} total posts." );
|
| 72 |
+
while( $posts->post_count ) {
|
| 73 |
+
|
| 74 |
+
foreach( $posts->posts as $single_post ) {
|
| 75 |
+
|
| 76 |
+
$count++;
|
| 77 |
+
|
| 78 |
+
$terms = wp_get_post_terms( $single_post->ID, $coauthors_plus->coauthor_taxonomy );
|
| 79 |
+
if ( is_wp_error( $terms ) )
|
| 80 |
+
WP_CLI::error( $terms->get_error_message() );
|
| 81 |
+
|
| 82 |
+
if ( ! empty( $terms ) ) {
|
| 83 |
+
WP_CLI::line( "{$count}/{$posts->found_posts}) Skipping - Post #{$single_post->ID} '{$single_post->post_title}' already has these terms: " . implode( ', ', wp_list_pluck( $terms, 'name' ) ) );
|
| 84 |
+
continue;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
$author = ( ! empty( $authors[$single_post->post_author] ) ) ? $authors[$single_post->post_author] : get_user_by( 'id', $single_post->post_author );
|
| 88 |
+
$authors[$single_post->post_author] = $author;
|
| 89 |
+
|
| 90 |
+
$author_term = ( ! empty( $author_terms[$single_post->post_author] ) ) ? $author_terms[$single_post->post_author] : $coauthors_plus->update_author_term( $author );
|
| 91 |
+
$author_terms[$single_post->post_author] = $author_term;
|
| 92 |
+
|
| 93 |
+
wp_set_post_terms( $single_post->ID, array( $author_term->slug ), $coauthors_plus->coauthor_taxonomy );
|
| 94 |
+
WP_CLI::line( "{$count}/{$posts->found_posts}) Added - Post #{$single_post->ID} '{$single_post->post_title}' now has an author term for: " . $author->user_nicename );
|
| 95 |
+
$affected++;
|
| 96 |
+
if ( $affected && $affected % 10 == 0 )
|
| 97 |
+
sleep( 3 );
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
$this->stop_the_insanity();
|
| 101 |
+
|
| 102 |
+
$this->args['paged']++;
|
| 103 |
+
$posts = new WP_Query( $this->args );
|
| 104 |
+
}
|
| 105 |
+
WP_CLI::line( "Updating author terms with new counts" );
|
| 106 |
+
foreach( $authors as $author ) {
|
| 107 |
+
$this->update_author_term( $author );
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
WP_CLI::success( "Done! Of {$posts->found_posts} posts, {$affected} now have author terms." );
|
| 111 |
+
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
/**
|
| 115 |
* Subcommand to assign coauthors to a post based on a given meta key
|
| 116 |
*
|
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.5.1
|
| 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 |
|
|
@@ -31,6 +31,16 @@ When a user is deleted from WordPress, they will be removed from all posts for w
|
|
| 31 |
|
| 32 |
Yep! Co-Authors Plus can be activated on a site-by-site basis, or network-activated. If you create guest authors, however, those guest authors will exist on a site-by-site basis.
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
== Upgrade Notice ==
|
| 35 |
|
| 36 |
= 3.0.4 =
|
|
@@ -41,6 +51,10 @@ Bug fixes and minor enhancements
|
|
| 41 |
|
| 42 |
== Changelog ==
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
= 3.0.4 (Jan. 6, 2013) =
|
| 45 |
* Support for automatically adding co-authors to your feeds. Props [cfg](https://github.com/cfg).
|
| 46 |
* Bug fix: No Co-Authors Plus on attachments. For now.
|
| 3 |
Tags: authors, users, multiple authors, coauthors, multi-author, publishing
|
| 4 |
Tested up to: 3.5.1
|
| 5 |
Requires at least: 3.3
|
| 6 |
+
Stable tag: 3.0.5
|
| 7 |
|
| 8 |
Assign multiple bylines to posts, pages, and custom post types via a search-as-you-type input box
|
| 9 |
|
| 31 |
|
| 32 |
Yep! Co-Authors Plus can be activated on a site-by-site basis, or network-activated. If you create guest authors, however, those guest authors will exist on a site-by-site basis.
|
| 33 |
|
| 34 |
+
= Who needs permission to do what? =
|
| 35 |
+
|
| 36 |
+
To assign co-authors to posts, a WordPress user will need the 'edit_others_posts' capability. This is typically granted to the Editor role, but can be altered with the 'coauthors_plus_edit_authors' filter.
|
| 37 |
+
|
| 38 |
+
To create new guest author profiles, a WordPress will need the 'list_users' capability. This is typically granted to the Administrator role, but can be altered with the 'coauthors_guest_author_manage_cap' filter.
|
| 39 |
+
|
| 40 |
+
= Can I easily create a list of all co-authors? =
|
| 41 |
+
|
| 42 |
+
Yep! There's a template tag called `coauthors_wp_list_authors()` that accepts many of the same arguments as `wp_list_authors()`. Look in template-tags.php for more details.
|
| 43 |
+
|
| 44 |
== Upgrade Notice ==
|
| 45 |
|
| 46 |
= 3.0.4 =
|
| 51 |
|
| 52 |
== Changelog ==
|
| 53 |
|
| 54 |
+
= 3.0.5 (Feb. 18, 2013) =
|
| 55 |
+
* New filter 'coauthors_search_authors_get_terms_args' allows you to increase the number of matches returned with AJAX co-author selection
|
| 56 |
+
* Bug fix: If there isn't an author term yet for a co-author, avoid an erronous join that caused duplicate posts to appear.
|
| 57 |
+
|
| 58 |
= 3.0.4 (Jan. 6, 2013) =
|
| 59 |
* Support for automatically adding co-authors to your feeds. Props [cfg](https://github.com/cfg).
|
| 60 |
* Bug fix: No Co-Authors Plus on attachments. For now.
|
screenshot-1.png
CHANGED
|
Binary file
|
screenshot-2.png
CHANGED
|
Binary file
|
screenshot-3.png
CHANGED
|
Binary file
|
template-tags.php
CHANGED
|
@@ -184,7 +184,16 @@ function coauthors__echo( $tag, $type = 'tag', $separators = array(), $tag_args
|
|
| 184 |
return $output;
|
| 185 |
}
|
| 186 |
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
function coauthors( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 189 |
return coauthors__echo('display_name', 'field', array(
|
| 190 |
'between' => $between,
|
|
@@ -193,6 +202,17 @@ function coauthors( $between = null, $betweenLast = null, $before = null, $after
|
|
| 193 |
'after' => $after
|
| 194 |
), null, $echo );
|
| 195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
function coauthors_posts_links( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 197 |
return coauthors__echo('coauthors_posts_links_single', 'callback', array(
|
| 198 |
'between' => $between,
|
|
@@ -201,6 +221,13 @@ function coauthors_posts_links( $between = null, $betweenLast = null, $before =
|
|
| 201 |
'after' => $after
|
| 202 |
), null, $echo );
|
| 203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
function coauthors_posts_links_single( $author ) {
|
| 205 |
$args = array(
|
| 206 |
'href' => get_author_posts_url( $author->ID, $author->user_nicename ),
|
|
@@ -218,6 +245,15 @@ function coauthors_posts_links_single( $author ) {
|
|
| 218 |
);
|
| 219 |
}
|
| 220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
function coauthors_firstnames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 222 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 223 |
'between' => $between,
|
|
@@ -226,6 +262,16 @@ function coauthors_firstnames($between = null, $betweenLast = null, $before = nu
|
|
| 226 |
'after' => $after
|
| 227 |
), 'first_name', $echo );
|
| 228 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
function coauthors_lastnames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 230 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 231 |
'between' => $between,
|
|
@@ -234,6 +280,16 @@ function coauthors_lastnames($between = null, $betweenLast = null, $before = nul
|
|
| 234 |
'after' => $after
|
| 235 |
), 'last_name', $echo );
|
| 236 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
function coauthors_nicknames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 238 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 239 |
'between' => $between,
|
|
@@ -242,6 +298,16 @@ function coauthors_nicknames($between = null, $betweenLast = null, $before = nul
|
|
| 242 |
'after' => $after
|
| 243 |
), 'nickname', $echo );
|
| 244 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
function coauthors_links($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 246 |
return coauthors__echo('coauthors_links_single', 'callback', array(
|
| 247 |
'between' => $between,
|
|
@@ -250,6 +316,13 @@ function coauthors_links($between = null, $betweenLast = null, $before = null, $
|
|
| 250 |
'after' => $after
|
| 251 |
), null, $echo );
|
| 252 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
function coauthors_links_single( $author ) {
|
| 254 |
if ( get_the_author_meta('url') ) {
|
| 255 |
return sprintf( '<a href="%s" title="%s" rel="external">%s</a>',
|
|
@@ -261,6 +334,16 @@ function coauthors_links_single( $author ) {
|
|
| 261 |
return get_the_author();
|
| 262 |
}
|
| 263 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
function coauthors_IDs($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 265 |
return coauthors__echo('ID', 'field', array(
|
| 266 |
'between' => $between,
|
| 184 |
return $output;
|
| 185 |
}
|
| 186 |
|
| 187 |
+
/**
|
| 188 |
+
* Outputs the co-authors display names, without links to their posts.
|
| 189 |
+
* Co-Authors Plus equivalent of the_author() template tag.
|
| 190 |
+
*
|
| 191 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 192 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 193 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 194 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 195 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 196 |
+
*/
|
| 197 |
function coauthors( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 198 |
return coauthors__echo('display_name', 'field', array(
|
| 199 |
'between' => $between,
|
| 202 |
'after' => $after
|
| 203 |
), null, $echo );
|
| 204 |
}
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* Outputs the co-authors display names, with links to their posts.
|
| 208 |
+
* Co-Authors Plus equivalent of the_author_posts_link() template tag.
|
| 209 |
+
*
|
| 210 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 211 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 212 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 213 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 214 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 215 |
+
*/
|
| 216 |
function coauthors_posts_links( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 217 |
return coauthors__echo('coauthors_posts_links_single', 'callback', array(
|
| 218 |
'between' => $between,
|
| 221 |
'after' => $after
|
| 222 |
), null, $echo );
|
| 223 |
}
|
| 224 |
+
|
| 225 |
+
/**
|
| 226 |
+
* Outputs a single co-author linked to their post archive.
|
| 227 |
+
*
|
| 228 |
+
* @param object $author
|
| 229 |
+
* @return string
|
| 230 |
+
*/
|
| 231 |
function coauthors_posts_links_single( $author ) {
|
| 232 |
$args = array(
|
| 233 |
'href' => get_author_posts_url( $author->ID, $author->user_nicename ),
|
| 245 |
);
|
| 246 |
}
|
| 247 |
|
| 248 |
+
/**
|
| 249 |
+
* Outputs the co-authors first names, without links to their posts.
|
| 250 |
+
*
|
| 251 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 252 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 253 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 254 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 255 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 256 |
+
*/
|
| 257 |
function coauthors_firstnames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){
|
| 258 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 259 |
'between' => $between,
|
| 262 |
'after' => $after
|
| 263 |
), 'first_name', $echo );
|
| 264 |
}
|
| 265 |
+
|
| 266 |
+
/**
|
| 267 |
+
* Outputs the co-authors last names, without links to their posts.
|
| 268 |
+
*
|
| 269 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 270 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 271 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 272 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 273 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 274 |
+
*/
|
| 275 |
function coauthors_lastnames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 276 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 277 |
'between' => $between,
|
| 280 |
'after' => $after
|
| 281 |
), 'last_name', $echo );
|
| 282 |
}
|
| 283 |
+
|
| 284 |
+
/**
|
| 285 |
+
* Outputs the co-authors nicknames, without links to their posts.
|
| 286 |
+
*
|
| 287 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 288 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 289 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 290 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 291 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 292 |
+
*/
|
| 293 |
function coauthors_nicknames($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 294 |
return coauthors__echo('get_the_author_meta', 'tag', array(
|
| 295 |
'between' => $between,
|
| 298 |
'after' => $after
|
| 299 |
), 'nickname', $echo );
|
| 300 |
}
|
| 301 |
+
|
| 302 |
+
/**
|
| 303 |
+
* Outputs the co-authors display names, with links to their websites if they've provided them.
|
| 304 |
+
*
|
| 305 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 306 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 307 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 308 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 309 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 310 |
+
*/
|
| 311 |
function coauthors_links($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 312 |
return coauthors__echo('coauthors_links_single', 'callback', array(
|
| 313 |
'between' => $between,
|
| 316 |
'after' => $after
|
| 317 |
), null, $echo );
|
| 318 |
}
|
| 319 |
+
|
| 320 |
+
/**
|
| 321 |
+
* Outputs a single co-author, linked to their website if they've provided one.
|
| 322 |
+
*
|
| 323 |
+
* @param object $author
|
| 324 |
+
* @return string
|
| 325 |
+
*/
|
| 326 |
function coauthors_links_single( $author ) {
|
| 327 |
if ( get_the_author_meta('url') ) {
|
| 328 |
return sprintf( '<a href="%s" title="%s" rel="external">%s</a>',
|
| 334 |
return get_the_author();
|
| 335 |
}
|
| 336 |
}
|
| 337 |
+
|
| 338 |
+
/**
|
| 339 |
+
* Outputs the co-authors IDs
|
| 340 |
+
*
|
| 341 |
+
* @param string $between Delimiter that should appear between the co-authors
|
| 342 |
+
* @param string $betweenLast Delimiter that should appear between the last two co-authors
|
| 343 |
+
* @param string $before What should appear before the presentation of co-authors
|
| 344 |
+
* @param string $after What should appear after the presentation of co-authors
|
| 345 |
+
* @param bool $echo Whether the co-authors should be echoed or returned. Defaults to true.
|
| 346 |
+
*/
|
| 347 |
function coauthors_IDs($between = null, $betweenLast = null, $before = null, $after = null, $echo = true ) {
|
| 348 |
return coauthors__echo('ID', 'field', array(
|
| 349 |
'between' => $between,
|
