HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/the-events-calendar/src/Tribe/Aggregator/Tabs/History.php
<?php
// Don't load directly
defined( 'WPINC' ) or die;

class Tribe__Events__Aggregator__Tabs__History extends Tribe__Events__Aggregator__Tabs__Abstract {

	/**
	 * This Tab Ordering priority
	 * @var integer
	 */
	public $priority = 30;

	/**
	 * Static Singleton Holder
	 *
	 * @var self
	 */
	private static $instance;

	/**
	 * Static Singleton Factory Method
	 *
	 * @return self
	 */
	public static function instance() {
		if ( ! self::$instance ) {
			self::$instance = new self;
		}

		return self::$instance;
	}

	public function __construct() {
		// Setup Abstract hooks
		parent::__construct();

		// Handle Screen Options
		add_action( 'current_screen', array( $this, 'action_screen_options' ) );
		add_filter( 'set-screen-option', array( $this, 'filter_save_screen_options' ), 10, 3 );
	}

	/**
	 * Adds Screen Options for This Tab
	 *
	 * @return void
	 */
	public function action_screen_options( $screen ) {
		if ( ! $this->is_active() ) {
			return;
		}

		$record_screen = WP_Screen::get( Tribe__Events__Aggregator__Records::$post_type );

		$args = array(
			'label'   => esc_html__( 'Records per page', 'the-events-calendar' ),
			'default' => 10,
			'option'  => 'tribe_records_history_per_page',
		);

		// We need to Add on both because of a WP Limitation on WP_Screen
		$record_screen->add_option( 'per_page', $args );
		$screen->add_option( 'per_page', $args );
	}

	/**
	 * Allows the saving for our created Page option
	 *
	 * @param mixed  $status Which value should be saved, if false will not save
	 * @param string $option Name of the option
	 * @param mixed  $value  Which value was saved
	 *
	 * @return mixed
	 */
	public function filter_save_screen_options( $status, $option, $value ) {
		if ( 'tribe_records_history_per_page' === $option ) {
			return $value;
		}

		return $status; // or return false;
	}

	public function is_visible() {
		$records = Tribe__Events__Aggregator__Records::instance();

		return $records->has_scheduled() || $records->has_history();
	}

	public function get_slug() {
		return 'history';
	}

	public function get_label() {
		return esc_html__( 'History', 'the-events-calendar' );
	}

}