Co-Authors Plus
Search For Author (2 posts)

  1. shafferb1
    Posted 3 years ago #

    I am using http://danielbachhuber.com/2012/02/07/include-posts-by-matching-authors-in-your-search-results/ together with Co-Authors Plus plugin.

    On the last few lines of the main function, I have:

    //This gives Array ( [0] => 2211 )

    $posts_search = str_replace( ')))', ")) OR ( {$wpdb->posts}.post_author IN (" . implode( ',', array_map( 'absint', $matching_users ) ) . ")))", $posts_search );
    error_log( $posts_search );
    return $posts_search;

    However, it is not returning posts where 2211 is the author. 2211 is the correct id of the author.

    Am I doing something wrong?



  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    What's the 'post_author' value in the database for the posts you're expecting to see? Have you looked at the full SQL query generated?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic