Event.php
904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace ACA\EC\Export\Strategy;
use ACA\EC\ListScreen;
use ACP;
/**
* Exportability class for events list screen
* @since 1.0.2
*/
class Event extends ACP\Export\Strategy\Post {
public function __construct( ListScreen\Event $list_screen ) {
parent::__construct( $list_screen );
}
/**
* @since 1.0
* @see ACP_Export_ExportableListScreen::ajax_export()
*/
protected function ajax_export(): void {
parent::ajax_export();
/**
* The Events Calender runs 'post_limits' to alter the limit for the admin list. In order for Export to work, we have to make sure the default 'WordPress' limit is used based on our query arguments
*/
add_filter( 'post_limits', [ $this, 'modify_posts_limit' ], 1 );
}
public function modify_posts_limit( $limit ): string {
remove_filter( 'post_limits', [ 'Tribe__Events__Admin_List', 'events_search_limits' ] );
return $limit;
}
}