search changed for wp_capabilities
Showing
1 changed file
with
8 additions
and
0 deletions
| ... | @@ -48,6 +48,13 @@ class UserSearch implements ArrayAccess, Iterator, Countable { | ... | @@ -48,6 +48,13 @@ class UserSearch implements ArrayAccess, Iterator, Countable { |
| 48 | $having = " HAVING `json` LIKE "; | 48 | $having = " HAVING `json` LIKE "; |
| 49 | if (is_array($field_match) && count($field_match) > 0) { | 49 | if (is_array($field_match) && count($field_match) > 0) { |
| 50 | foreach ($field_match as $key => $val) { | 50 | foreach ($field_match as $key => $val) { |
| 51 | if($key == 'wp_capabilities'){ | ||
| 52 | $pieces = explode("\"", $val); | ||
| 53 | $pieces = explode("\\", $pieces[1]); | ||
| 54 | $key = $pieces[0]; | ||
| 55 | $having_clause .= (empty($having_clause) ? $having : "\n AND `json` LIKE "); | ||
| 56 | $having_clause .= " '%{$key}%' "; | ||
| 57 | }else{ | ||
| 51 | if (!in_array($key, $this->fields)) { | 58 | if (!in_array($key, $this->fields)) { |
| 52 | $this->fields[] = $key; | 59 | $this->fields[] = $key; |
| 53 | } | 60 | } |
| ... | @@ -55,6 +62,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable { | ... | @@ -55,6 +62,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable { |
| 55 | $having_clause .= (empty($having_clause) ? $having : "\n AND `json` LIKE "); | 62 | $having_clause .= (empty($having_clause) ? $having : "\n AND `json` LIKE "); |
| 56 | $having_clause .= " '%\"{$key}\":\"{$val}%' "; | 63 | $having_clause .= " '%\"{$key}\":\"{$val}%' "; |
| 57 | } | 64 | } |
| 65 | } | ||
| 58 | } | 66 | } |
| 59 | 67 | ||
| 60 | // Open ended search | 68 | // Open ended search | ... | ... |
-
Please register or sign in to post a comment