LLMS_Student_Query::prepare_query()
Prepare the SQL for the query.
Return Return
(string)
Source Source
File: includes/class.llms.student.query.php
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | protected function prepare_query() { global $wpdb ; $vars = array (); if ( $this ->get( 'search' ) ) { $search = '%' . $wpdb ->esc_like( $this ->get( 'search' ) ) . '%' ; $vars [] = $search ; $vars [] = $search ; $vars [] = $search ; } $vars [] = $this ->get_skip(); $vars [] = $this ->get( 'per_page' ); // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $vars is an array with the correct number of items. $sql = $wpdb ->prepare( "SELECT { $this ->sql_select()} FROM { $wpdb ->users} AS u { $this ->sql_joins()} { $this ->sql_search()} { $this ->sql_having()} { $this ->sql_orderby()} LIMIT %d, %d;", $vars ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared return $sql ; } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Renamed from preprare_query() . |
4.10.2 | Demands to $this->sql_select() to determine whether or not SQL_CALC_FOUND_ROWS statement is needed. |
3.4.0 | |
3.13.0 | Introduced. |