BP_Document_Query::get_sql_document( string $alias = 'd' )
Generates WHERE SQL clause to be appended to a main query.
Description
Parameters
- $alias
-
(Optional) An existing table alias that is compatible with the current query clause. Default: 'a'. BP_Document::get() uses 'a', so we default to that.
Default value: 'd'
Return
(string) SQL fragment to append to the main WHERE clause.
Source
File: bp-document/classes/class-bp-document-query.php
public function get_sql_document( $alias = 'd' ) { if ( ! empty( $alias ) ) { $this->table_alias = sanitize_title( $alias ); } $sql = $this->get_sql_clauses(); // We only need the 'where' clause. // // Also trim trailing "AND" clause from parent BP_Recursive_Query class // since it's not necessary for our needs. return preg_replace( '/^\sAND/', '', $sql['where'] ); }
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.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.