WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
Search For Author (2 posts)

  1. shafferb1
    Member
    Posted 1 year 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:

    Print_r($matching_users);
    //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?

    Thanks

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year 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

About this Topic