PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.1.2
Fluent Support – Helpdesk & Customer Support Ticket System v2.1.2
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
fluent-support / app / Models / Model.php

Model.php in Fluent Support – Helpdesk & Customer Support Ticket System 2.1.2, at app/Models/Model.php

35 lines 983 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\App\Models;
4
5 use FluentSupport\Framework\Database\Orm\Model as BaseModel;
6
7 class Model extends BaseModel
8 {
9 protected $guarded = ['id', 'ID'];
10
11 public function __construct($attributes = [])
12 {
13 parent::__construct($attributes);
14 }
15
16 public function getPerPage()
17 {
18 if (!isset($_REQUEST['per_page'])) {
19 return 15;
20 }
21
22 if (isset($_REQUEST['nonce'])) {
23 $nonceAction = (defined('REST_REQUEST') && REST_REQUEST) ? 'wp_rest' : 'fluent-support';
24
25 if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['nonce'])), $nonceAction)) {
26 return 15;
27 }
28 } elseif (is_admin() || wp_doing_ajax() || (defined('REST_REQUEST') && REST_REQUEST)) {
29 return intval(sanitize_text_field(wp_unslash($_REQUEST['per_page']))) ?? 15;
30 }
31
32 return intval(sanitize_text_field(wp_unslash($_REQUEST['per_page'])));
33 }
34 }
35