<?php namespace MailPoet\Listing; if (!defined('ABSPATH')) exit; use MailPoet\WP\Functions as WPFunctions; class PageLimit { const DEFAULT_LIMIT_PER_PAGE = 20; /** @var WPFunctions */ private $wp; public function __construct( WPFunctions $wp ) { $this->wp = $wp; } public function getLimitPerPage($model = null) { if ($model === null) { return self::DEFAULT_LIMIT_PER_PAGE; } $listingPerPage = $this->wp->getUserMeta( $this->wp->getCurrentUserId(), 'mailpoet_' . $model . '_per_page', true ); return (!empty($listingPerPage)) ? (int)$listingPerPage : self::DEFAULT_LIMIT_PER_PAGE; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
BulkActionController.php | File | 812 B | 0644 |
|
BulkActionFactory.php | File | 1007 B | 0644 |
|
Handler.php | File | 4.98 KB | 0644 |
|
ListingDefinition.php | File | 1.69 KB | 0644 |
|
ListingRepository.php | File | 3.51 KB | 0644 |
|
PageLimit.php | File | 662 B | 0644 |
|
index.php | File | 0 B | 0644 |
|