Skip to content

Instantly share code, notes, and snippets.

@wpmudev-sls
Created April 17, 2018 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/c19d91884cafcb831fc2a49c83e40dcd to your computer and use it in GitHub Desktop.
Save wpmudev-sls/c19d91884cafcb831fc2a49c83e40dcd to your computer and use it in GitHub Desktop.
Events+ Increase the limit of max result
<?php
/**
* Plugin Name: Events + max result limit increase
* Plugin URI: https://premium.wpmudev.org/
* Description: Increase the limit of max result
* Author: Ariful Islam @ WPMUDEV
* Author URI: https://premium.wpmudev.org/profile/itsarifulislam
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'EAB_MaxResultLimitIncrease' ) ) {
class EAB_MaxResultLimitIncrease {
private static $_instance = null;
private $limit = 3000; // Update the limit as appropriate
public static function get_instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new EAB_MaxResultLimitIncrease();
}
return self::$_instance;
}
private function __construct() {
if ( !class_exists('Eab_EventsHub') ) return;
add_action('eab-collection-upcoming-max_results', array($this, 'eab_collection_upcoming_max_results'), 10, 1);
}
public function eab_collection_upcoming_max_results() {
return $this->limit;
}
}
function Render_eab_max_result_limit_increase(){
$GLOBALS['EAB_MaxResultLimitIncrease'] = EAB_MaxResultLimitIncrease::get_instance();
}
}
add_action( 'init', 'Render_eab_max_result_limit_increase' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment