WordPress.org

Ready to get started?Download WordPress

Forums

bbPress Moderation
[resolved] Posts Not Showing for WordPress Installations that use DB prefix (3 posts)

  1. mgropel
    Member
    Posted 11 months ago #

    After activating the bbpressmoderation plug-in my bbpress forum topics were no longer visible. After some digging, it appears to me that there is a bug in the posts_where function. This function was not taking into account those wp sites that use a database prefix. I fixed this by making the following change in the posts_where function:

    global $wpdb;
    $where = str_ireplace($wpdb->prefix."wp_posts.post_status = 'publish'", "(".$wpdb->prefix."wp_posts.post_status = 'publish' OR ".$wpdb->prefix."wp_posts.post_status = 'pending')", $where);

    Hope this helps.

    http://wordpress.org/plugins/bbpressmoderation/

  2. Ian Stanley
    Member
    Plugin Author

    Posted 11 months ago #

    Now in the development tree - should be in the 1.8 release (hopefully in september'13). Watch for the next update

  3. Ian Stanley
    Member
    Plugin Author

    Posted 11 months ago #

    NB for those of you following the thread just to learn more about the source mgropel meant:

    global $wpdb;
    $where = str_ireplace($wpdb->prefix."posts.post_status = 'publish'", "(".$wpdb->prefix."posts.post_status = 'publish' OR ".$wpdb->prefix."posts.post_status = 'pending')", $where);

    note the dropping of the wp_ prefix to be replaced by $wpdb->prefix (else you get wp_wp_... which screws up the query.

    Thanks for the code. It is now tested and in the latest dev release.

Reply

You must log in to post.

About this Plugin

About this Topic