WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Doesn't work with database prefixes

[Resolved] Doesn't work with database prefixes

  • Dave Ross
    Participant

    @csixty4

    I specified a custom database prefix when setting up my site, and My Post Order was giving an error when displaying posts. I had to patch it to support custom database prefixes.

    In functions.php, mpo_change_condition()…

    Add $wpdb to the list of global variables:

    global $wp_query, $post_ids, $wpdb;

    Use the database prefix when building a query:

    $where .= ‘AND ‘ . $wpdb->prefix . ‘posts.ID IN (‘ . $post_ids . ‘)’;

    http://wordpress.org/extend/plugins/my-posts-order/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Doesn't work with database prefixes’ is closed to new replies.