| @@ 402-416 (lines=15) @@ | ||
| 399 | * @global wpdb $wpdb |
|
| 400 | * @return string |
|
| 401 | */ |
|
| 402 | private function get_where_user() { |
|
| 403 | $where = ''; |
|
| 404 | ||
| 405 | // Donors create for specific wp user. |
|
| 406 | if ( ! empty( $this->args['user'] ) ) { |
|
| 407 | if ( ! is_array( $this->args['user'] ) ) { |
|
| 408 | $this->args['user'] = explode( ',', $this->args['user'] ); |
|
| 409 | } |
|
| 410 | $user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) ); |
|
| 411 | ||
| 412 | $where .= "AND {$this->table_name}.user_id IN( {$user_ids} )"; |
|
| 413 | } |
|
| 414 | ||
| 415 | return $where; |
|
| 416 | } |
|
| 417 | ||
| 418 | /** |
|
| 419 | * Set orderby query |
|
| @@ 315-329 (lines=15) @@ | ||
| 312 | * @global wpdb $wpdb |
|
| 313 | * @return string |
|
| 314 | */ |
|
| 315 | private function get_where_donor() { |
|
| 316 | $where = ''; |
|
| 317 | ||
| 318 | // Specific donors. |
|
| 319 | if ( ! empty( $this->args['donor'] ) ) { |
|
| 320 | if ( ! is_array( $this->args['donor'] ) ) { |
|
| 321 | $this->args['donor'] = explode( ',', $this->args['donor'] ); |
|
| 322 | } |
|
| 323 | $donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) ); |
|
| 324 | ||
| 325 | $where .= "AND {$this->table_name}.id IN( {$donor_ids} )"; |
|
| 326 | } |
|
| 327 | ||
| 328 | return $where; |
|
| 329 | } |
|
| 330 | ||
| 331 | /** |
|
| 332 | * Set date where clause. |
|