ACF.php
3 months ago
BeaverBuilder.php
3 months ago
BuddyPress.php
3 months ago
EventsCalendar.php
3 months ago
Filter.php
3 months ago
GravityForms.php
3 months ago
IntegrationRepository.php
3 months ago
JetEngine.php
3 months ago
MediaLibraryAssistant.php
3 months ago
MetaBox.php
3 months ago
Pods.php
3 months ago
RankMath.php
3 months ago
SeoPress.php
3 months ago
Types.php
3 months ago
WooCommerce.php
3 months ago
YoastSeo.php
3 months ago
EventsCalendar.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Integration; |
| 4 | |
| 5 | use AC\PostType; |
| 6 | use AC\Screen; |
| 7 | use AC\TableScreen; |
| 8 | use AC\Type\Integration; |
| 9 | use AC\Type\Url\Site; |
| 10 | |
| 11 | final class EventsCalendar extends Integration |
| 12 | { |
| 13 | |
| 14 | public function __construct() |
| 15 | { |
| 16 | parent::__construct( |
| 17 | 'ac-addon-events-calendar', |
| 18 | __('Events Calendar', 'codepress-admin-columns'), |
| 19 | 'assets/images/addons/events-calendar.png', |
| 20 | __( |
| 21 | 'See event dates, venues, organizers, and ticket data at a glance. Sort by date, filter by venue, and bulk edit event details without opening each event individually.', |
| 22 | 'codepress-admin-columns' |
| 23 | ), |
| 24 | null, |
| 25 | new Site(Site::PAGE_ADDON_EVENTS_CALENDAR) |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | public function is_plugin_active(): bool |
| 30 | { |
| 31 | return class_exists('Tribe__Events__Main'); |
| 32 | } |
| 33 | |
| 34 | private function get_post_types(): array |
| 35 | { |
| 36 | return [ |
| 37 | 'tribe_events', |
| 38 | 'tribe_organizer', |
| 39 | 'tribe_venue', |
| 40 | 'tribe_event_series', |
| 41 | ]; |
| 42 | } |
| 43 | |
| 44 | public function show_notice(Screen $screen): bool |
| 45 | { |
| 46 | return 'edit' === $screen->get_base() |
| 47 | && in_array($screen->get_post_type(), $this->get_post_types()); |
| 48 | } |
| 49 | |
| 50 | public function show_placeholder(TableScreen $table_screen): bool |
| 51 | { |
| 52 | return $table_screen instanceof PostType && in_array( |
| 53 | (string)$table_screen->get_post_type(), |
| 54 | $this->get_post_types() |
| 55 | ); |
| 56 | } |
| 57 | |
| 58 | } |