-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from thenewinquiry/1.0.8
#19 Added Co-authors Plus support
- Loading branch information
Showing
5 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Tni Core Template Tags | ||
* | ||
* @package Tni_Core | ||
* @subpackage Tni_Core\Includes | ||
* @since 1.0.8 | ||
* @license GPL-2.0+ | ||
*/ | ||
|
||
/** | ||
* Display Autbor(s) | ||
* If Co-authors Plus is active, return co-author links | ||
* | ||
* @since 1.0.8 | ||
* | ||
* @uses coauthors_posts_links() | ||
* @uses get_author_posts_url() | ||
* @uses get_the_author() | ||
* | ||
* @return string | ||
*/ | ||
function tni_core_authors() { | ||
|
||
if( function_exists( 'coauthors_posts_links' ) ) { | ||
$author_string = coauthors_posts_links( ', ', __( ' and ', 'tni' ), '<span class="author vcard">' . __( 'By ', 'tni' ), '</span>', false ); | ||
} else { | ||
$author_string = sprintf( '<span class="author vcard">%s<a class="url fn n" href="%s" title="%s" rel="author">%s</a></span>', | ||
__( 'By ', 'tni' ), | ||
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), | ||
esc_attr( sprintf( esc_html__( 'View all posts by %s', 'tni' ), | ||
get_the_author() ) ), | ||
esc_html( get_the_author() ) | ||
); | ||
} | ||
|
||
return '<span class="meta-author"> ' . $author_string . '</span>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters