Support » Plugin: New User Approve » Seems to be working

  • Seems to do what it says on the tin.

    User table filtering by status doesn’t seem to work so I edited out the functionality for now. Haven’t had any other problems so far.

    Thanks for a nice plugin!

    • This topic was modified 2 years, 8 months ago by ooksanen.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi ooksanen,

    where did you edit the table funcionality?

    I am facing the same filter issue

    thx

    replace word wp_usermeta with {$wpdb->usermeta} in query in includes/user-list.php

    if ( $this->selected_status() != null ) {
    $filter = $this->selected_status();

    $query->query_from .= ” INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = wp_usermeta.user_id )”;

    if ( ‘approved’ == $filter ) {
    // $query->query_fields = “DISTINCT SQL_CALC_FOUND_ROWS {$wpdb->users}.ID”;
    //$query->query_from .= ” LEFT JOIN {$wpdb->usermeta} AS mt1 ON ({$wpdb->users}.ID = mt1.user_id AND mt1.meta_key = ‘pw_user_status’)”;
    //$query->query_where .= ” AND ( ( wp_usermeta.meta_key = ‘pw_user_status’ AND CAST(wp_usermeta.meta_value AS CHAR) = ‘approved’ ) OR mt1.user_id IS NULL )”;
    } else {
    //$query->query_where .= ” AND ( (wp_usermeta.meta_key = ‘pw_user_status’ AND CAST(wp_usermeta.meta_value AS CHAR) = ‘{$filter}’) )”;
    }
    }

    with

    if ( $this->selected_status() != null ) {
    $filter = $this->selected_status();

    $query->query_from .= ” INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = {$wpdb->usermeta}.user_id )”;

    if ( ‘approved’ == $filter ) {
    $query->query_fields = “DISTINCT SQL_CALC_FOUND_ROWS {$wpdb->users}.ID”;
    $query->query_from .= ” LEFT JOIN {$wpdb->usermeta} AS mt1 ON ({$wpdb->users}.ID = mt1.user_id AND mt1.meta_key = ‘pw_user_status’)”;
    $query->query_where .= ” AND ( ( {$wpdb->usermeta}.meta_key = ‘pw_user_status’ AND CAST({$wpdb->usermeta}.meta_value AS CHAR) = ‘approved’ ) OR mt1.user_id IS NULL )”;
    } else {
    $query->query_where .= ” AND ( ({$wpdb->usermeta}.meta_key = ‘pw_user_status’ AND CAST({$wpdb->usermeta}.meta_value AS CHAR) = ‘{$filter}’) )”;
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Seems to be working’ is closed to new replies.