• WP 3.8.1

    Trying to do a keyword search for user, but the SQL has no wildcards in the LIKE statements in the WHERE part. Is this a known bug?

    ` [query_fields] => DISTINCT SQL_CALC_FOUND_ROWS wp_users.*
    [query_from] => FROM wp_users INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id)
    INNER JOIN wp_usermeta AS mt1 ON (wp_users.ID = mt1.user_id)
    [query_where] => WHERE 1=1 AND (user_login LIKE ‘a’ OR user_nicename LIKE ‘a’) AND ( (wp_usermeta.meta_key = ‘wp_capabilities’ AND CAST(wp_usermeta.meta_value AS CHAR) LIKE ‘%gigrobot\\_booker%’)
    OR (mt1.meta_key = ‘wp_capabilities’ AND CAST(mt1.meta_value AS CHAR) LIKE ‘%gigrobot\\_purchaser%’) )
    [query_orderby] => ORDER BY display_name ASC
    [query_limit] => `

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WP_User search by keyword – lacking wildcard in sql query’ is closed to new replies.