Title: [Plugin: Co-Authors Plus] Feature: Iterator Filter
Last modified: August 20, 2016

---

# [Plugin: Co-Authors Plus] Feature: Iterator Filter

 *  [Jeffrey](https://wordpress.org/support/users/h0tw1r3/)
 * (@h0tw1r3)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-co-authors-plus-feature-iterator-filter/)
 * Co-authors-plus is a great plugin! Thanks for all the hard work.
 * I would like to suggest one feature, a filter to the iterator. Currently I apply
   WP’s ‘the_author’ filter, but any filter hook would be very convenient.
 *     ```
       --- a/wp-content/plugins/co-authors-plus/template-tags.php
       +++ b/wp-content/plugins/co-authors-plus/template-tags.php
       @@ -145,6 +145,16 @@ function coauthors__echo( $tag, $type = 'tag', $separators = array(), $tag_args
        		if( empty( $author_text ) )
        			$author_text = $i->current_author->user_login;
   
       +		/*
       +		 * CUSTOMIZATION: Apply wordpress filter
       +		 */
       +		$author_text = apply_filters( 'the_author', $author_text );
       +		if ( empty( $author_text ) ) {
       +			$i->count = $i->count - 1;
       +			$i->position = $i-position - 1;
       +			continue;
       +		}
       +
        		// Append separators
        		if ( ! $i->is_first() && $i->count() > 2 )
        			$output .= $separators['between'];
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-co-authors-plus-feature-iterator-filter/#post-2556775)
 * Sounds reasonable 🙂 Want to prepare a pull request for this on Github?
 * My preference would be to apply a filter called ‘the_coauthor’, and then you 
   can hook whatever you’d like onto that.
 * Also, make sure your code actually executes (e.g. “$i-position” looks broken),
   and you can decrement with $i->position– or similar.
 * Lastly, if you could prepare an example use case when you submit your pull request
   so I can properly test, that’d be wonderful.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Co-Authors Plus] Feature: Iterator Filter’ is closed to new 
replies.

 * ![](https://ps.w.org/co-authors-plus/assets/icon-256x256.png?rev=2945095)
 * [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/co-authors-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/co-authors-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/co-authors-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/co-authors-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/co-authors-plus/reviews/)

## Tags

 * [feature-requests](https://wordpress.org/support/topic-tag/feature-requests/)

 * 1 reply
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-co-authors-plus-feature-iterator-filter/#post-2556775)
 * Status: not resolved