HEX
Server: LiteSpeed
System: Linux server019.our-control-panel.com 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: aashishs (1103)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/aashishs/animegrantha.com/wp-content/plugins/mailpoet/lib/Listing/PageLimit.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

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;
  }
}