Just to clarify: Do you want this to return posts where key = 'the same author name' OR key = NULL, but not return posts where key = 'other author name'?
–
Andy AdamsDec 5 '12 at 19:02

Yes, it's something like co-authors. If the author template is displayed, the user will see your posts. In addition, because of your user_login (or ID, display_name...) could be in the meta values of other posts, those posts should be displayed too.
–
alekstrustDec 6 '12 at 6:14

1 Answer
1

The WP_Query class will automatically AND any filters that are set. In your case, using $query->set( 'meta_query', ... ) means that WordPress will be looking for posts from the current author (because this is the author template) AND that have your custom meta key. From my understanding of your problem, this intentionally will never happen, so the query can't be modified this way.

Instead, you'll need the posts_where filter to add an OR condition to the WHERE clause: