WordPress.org

Support

Support » Plugins and Hacks » bbPress Moderation » [Resolved] Posts Not Showing for WordPress Installations that use DB prefix

[Resolved] Posts Not Showing for WordPress Installations that use DB prefix

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ian Stanley

    @iandstanley

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

    Plugin Contributor Ian Stanley

    @iandstanley

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Posts Not Showing for WordPress Installations that use DB prefix’ is closed to new replies.
Skip to toolbar