HEX
Server: LiteSpeed
System: Linux server902.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: deshuvsd (2181)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/deshuvsd/www/wp-content/plugins/jetformbuilder/components/rest-api/traits/paginated-args.php
<?php


namespace JFB_Components\Rest_Api\Traits;

use Jet_Form_Builder\Db_Queries\Views\View_Base;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

trait Paginated_Args {

	protected function get_paginate_args( \WP_REST_Request $request ) {
		$body = $request->get_query_params();

		return array(
			'limit'   => (int) ( $body['limit'] ?? 5 ),
			'sort'    => $body['sort'] ?? View_Base::FROM_HIGH_TO_LOW,
			'page'    => (int) ( $body['page'] ?? 1 ),
			'filters' => (array) ( $body['filters'] ?? array() ),
		);
	}

}