Forum Replies Created

Viewing 1 replies (of 1 total)
  • I encountered the same error, this is the bug in co-authors plugin.
    There is a quick fix for it:
    Search for function posts_where_filter() in co-author-plus.php and then search for line

    $where = preg_replace( '/(\b(?:' . $wpdb->posts . '\.)?post_author\s*=\s*(' . get_current_user_id() . '))/', $current_user_query, $where, -1 ); #' . $wpdb->postmeta . '.meta_id IS NOT NULL AND
    near the end of this function

    You should replace it with

    $where = preg_replace( '/(\b(?:' . $wpdb->posts . '\.)?post_author\s*=\s*(' . get_current_user_id() . ')\b)/', $current_user_query, $where, -1 ); #' . $wpdb->postmeta . '.meta_id IS NOT NULL AND

    I added \b to only match on word boundaries. Previously it matched current user id as a substring of post_author id and that caused problems.

Viewing 1 replies (of 1 total)