BP_Media_Model::rows( $columns )
Fetch the rows
Description
Parameters
- $columns
-
(Required)
Return
(null|string)
Source
File: bp-media/classes/class-bp-media-model.php
static function rows( $columns ) { $select = 'SELECT COUNT(*) FROM ' . self::_table(); $where = ' where 2=2 '; foreach ( $columns as $colname => $colvalue ) { if ( is_array( $colvalue ) ) { if ( ! isset( $colvalue['compare'] ) ) { $compare = 'IN'; } else { $compare = $colvalue['compare']; } if ( ! isset( $colvalue['value'] ) ) { $colvalue['value'] = $colvalue; } $col_val_comapare = ( $colvalue['value'] ) ? '(\'' . implode( "','", $colvalue['value'] ) . '\')' : ''; $where .= " AND " . self::_table() . ".{$colname} {$compare} {$col_val_comapare}"; } else { $where .= " AND " . self::_table() . ".{$colname} = '{$colvalue}'"; } } $sql = $select . $where; global $wpdb; return $wpdb->get_var( $sql ); }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.