• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors
  • My Account

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI
  • Changelog Subscribe

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_Query_User_Postmeta / LLMS_Query_User_Postmeta::preprare_query()

LLMS_Query_User_Postmeta::preprare_query()

Prepare the SQL for the query.

Contents

  • Return
  • Source
  • Changelog
  • User Contributed Notes

Return #Return

(string)


Top ↑

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


Top ↑

Changelog #Changelog

Changelog
Version Description
3.15.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

© 2014 - 2026 LifterLMS · Privacy Policy · Terms and Conditions

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.