Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Student_Query::sql_subquery( string $column, string $meta_key = '_status' )

Generate an SQL subquery for the meta key in the main query.


Parameters Parameters

$column

(string) (Required) Column name.

$meta_key

(string) (Optional) meta key to use in the WHERE condition. Defaults to '_status'.

Default value: '_status'


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class.llms.student.query.php

	private function sql_subquery( $column, $meta_key = '_status' ) {

		global $wpdb;

		$post_ids = $this->get( 'post_id' );
		if ( $post_ids ) {
			$post_ids = implode( ',', $post_ids );
			$and      = "AND post_id IN ( {$post_ids} )";
		} else {
			$and = "AND {$this->sql_status_in( 'meta_value' )}";
		}

		return "SELECT {$column}
				FROM {$wpdb->prefix}lifterlms_user_postmeta
				WHERE meta_key = '{$meta_key}'
		  		  AND user_id = id
		  		  {$and}
				ORDER BY updated_date DESC
				LIMIT 1";
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.10.0 Add $meta_key argument.
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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