Changeset 153846
- Timestamp:
- 09/11/2009 03:57:22 PM (17 years ago)
- Location:
- wt-co-authors
- Files:
-
- 3 added
- 1 edited
-
tags/1.7 (added)
-
tags/1.7/readme.txt (added)
-
tags/1.7/wt-coauthors.php (added)
-
trunk/wt-coauthors.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wt-co-authors/trunk/wt-coauthors.php
r147595 r153846 4 4 Plugin URI: http://anime2.kokidokom.net/all-team-blogs-attention-the-ultimate-mega-super-awesome-co-authors-plugin-is-here/ 5 5 Description: Displays co-authors of a post. Uses custom fields (key=<code>coauthor</code>;value=user's username) 6 Version: 1. 56 Version: 1.7 7 7 Author: Eugen Rochko 8 8 Author URI: http://anime2.kokidokom.net/ … … 68 68 } 69 69 70 //Filter for the author archives, displaying collaborative posts there 71 //Input: $posts, the array of the filter the_posts 72 function wt_include_coauthors($posts) { 73 global $wp_query; 74 if(is_author()): 75 $curauth = get_userdata($author->ID); 76 $curauth_name = $curauth->user_login; 77 $au_posts = get_posts('meta_key=coauthor&meta_value=' . $curauth_name); 78 $all_posts = array_merge($posts, $au_posts); 79 $all_posts = array_unique($all_posts); 80 return $all_posts; 81 else: 82 return $posts; 83 endif; 84 } 85 70 86 //The filtering, for automatisation. 71 87 add_filter('the_author', 'wt_the_coauthors'); 88 add_filter('the_posts', 'wt_include_coauthors', 1); 72 89 73 90 ?>
Note: See TracChangeset
for help on using the changeset viewer.