Filter
4 years ago
ACF.php
4 years ago
BuddyPress.php
4 years ago
EventsCalendar.php
4 years ago
Filter.php
4 years ago
GravityForms.php
4 years ago
MetaBox.php
4 years ago
NinjaForms.php
4 years ago
Pods.php
4 years ago
Types.php
4 years ago
WooCommerce.php
4 years ago
YoastSeo.php
4 years ago
EventsCalendar.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Integration; |
| 4 | |
| 5 | use AC\Integration; |
| 6 | use AC\ListScreen; |
| 7 | use AC\ListScreenPost; |
| 8 | use AC\Screen; |
| 9 | use AC\Type\Url\Site; |
| 10 | |
| 11 | final class EventsCalendar extends Integration { |
| 12 | |
| 13 | public function __construct() { |
| 14 | parent::__construct( |
| 15 | 'ac-addon-events-calendar/ac-addon-events-calendar.php', |
| 16 | __( 'Events Calendar', 'codepress-admin-columns' ), |
| 17 | 'assets/images/addons/events-calendar.png', |
| 18 | sprintf( |
| 19 | '%s %s', |
| 20 | sprintf( __( 'Integrates %s with Admin Columns.', 'codepress-admin-columns' ), __( 'Events Calendar', 'codepress-admin-columns' ) ), |
| 21 | __( 'Display, inline- and bulk-edit, export, smart filter and sort your Events, Organizers and Venues.', 'codepress-admin-columns' ) |
| 22 | ), |
| 23 | null, |
| 24 | new Site( Site::PAGE_ADDON_EVENTS_CALENDAR ) |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | public function is_plugin_active() { |
| 29 | return class_exists( 'Tribe__Events__Main' ); |
| 30 | } |
| 31 | |
| 32 | private function get_post_types() { |
| 33 | return [ |
| 34 | 'tribe_events', |
| 35 | 'tribe_organizer', |
| 36 | 'tribe_venue', |
| 37 | ]; |
| 38 | } |
| 39 | |
| 40 | public function show_notice( Screen $screen ) { |
| 41 | return 'edit' === $screen->get_base() |
| 42 | && in_array( $screen->get_post_type(), $this->get_post_types() ); |
| 43 | } |
| 44 | |
| 45 | public function show_placeholder( ListScreen $list_screen ) { |
| 46 | return $list_screen instanceof ListScreenPost |
| 47 | && in_array( $list_screen->get_post_type(), $this->get_post_types() ); |
| 48 | } |
| 49 | |
| 50 | } |