LLMS_Query_User_Postmeta::preprare_query()
Prepare the SQL for the query.
Contents
Return Return
(string)
Source Source
File: includes/class.llms.query.user.postmeta.php
* @since 6.0.0 Renamed from `preprare_query()`.
* @since 10.0.0 Build count_query from shared clauses instead of using SQL_CALC_FOUND_ROWS.
*
* @return string
*/
protected function prepare_query() {
global $wpdb;
$from = "FROM {$wpdb->prefix}lifterlms_user_postmeta";
$where = $this->sql_where();
if ( $this->get( 'count_only' ) ) {
return "SELECT COUNT(*) AS total {$from} {$where};";
}
if ( ! $this->get( 'no_found_rows' ) ) {
$this->count_query = "SELECT COUNT(*) {$from} {$where}";
}
$vars = array(
$this->get_skip(),
$this->get( 'per_page' ),
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.15.0 | Introduced. |