BP_Invitation::get_paged_sql( array $args = array() )

Assemble the LIMIT clause of a get() SQL statement.


Description Description

Used by BP_Invitation::get() to create its LIMIT clause.


Top ↑

Parameters Parameters

$args

(array) (Optional) See BP_Invitation::get() for more details.

Default value: array()


Top ↑

Return Return

(string) LIMIT clause.


Source Source

File: bp-core/classes/class-bp-invitation.php

	protected static function get_paged_sql( $args = array() ) {
		global $wpdb;

		// Setup local variable.
		$retval = '';

		// Custom LIMIT.
		if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
			$page     = absint( $args['page']     );
			$per_page = absint( $args['per_page'] );
			$offset   = $per_page * ( $page - 1 );
			$retval   = $wpdb->prepare( "LIMIT %d, %d", $offset, $per_page );
		}

		return $retval;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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