Changeset 186594
- Timestamp:
- 12/23/2009 03:09:49 PM (16 years ago)
- Location:
- wt-co-authors/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wt-coauthors.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wt-co-authors/trunk/readme.txt
r153848 r186594 2 2 Tags: authors, links, plugin, posts, post 3 3 Requires at least: 2.8 4 Tested up to: 2. 8.44 Tested up to: 2.9 5 5 Stable tag: trunk 6 6 … … 21 21 22 22 = 1.7 = 23 * Author archives now display collaborative posts as well23 * Little filter enhancement 24 24 25 25 = 1.5 = -
wt-co-authors/trunk/wt-coauthors.php
r153846 r186594 70 70 //Filter for the author archives, displaying collaborative posts there 71 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 }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 85 86 86 //The filtering, for automatisation. 87 87 add_filter('the_author', 'wt_the_coauthors'); 88 add_filter(' the_posts', 'wt_include_coauthors', 1);88 add_filter('get_the_author_display_name', 'wt_the_coauthors'); 89 89 90 90 ?>
Note: See TracChangeset
for help on using the changeset viewer.