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

  1. mgropel
    Posted 2 years 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.


  2. Ian Stanley
    Plugin Author

    Posted 2 years 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
    Plugin Author

    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • bbPress Moderation
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic