ACF.php
5 years ago
BuddyPress.php
5 years ago
EventsCalendar.php
5 years ago
GravityForms.php
5 years ago
MetaBox.php
5 years ago
NinjaForms.php
5 years ago
Pods.php
5 years ago
Types.php
5 years ago
WooCommerce.php
5 years ago
YoastSeo.php
5 years ago
NinjaForms.php
42 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 NinjaForms extends Integration { |
| 12 | |
| 13 | public function __construct() { |
| 14 | parent::__construct( |
| 15 | 'ac-addon-ninjaforms/ac-addon-ninjaforms.php', |
| 16 | __( 'Ninja Forms', 'codepress-admin-columns' ), |
| 17 | 'assets/images/addons/ninja-forms.png', |
| 18 | __( 'Add Ninja Forms columns that can be sorted, filtered and directly edited!', 'codepress-admin-columns' ), |
| 19 | null, |
| 20 | new Site( Site::PAGE_ADDON_NINJA_FORMS ) |
| 21 | ); |
| 22 | } |
| 23 | |
| 24 | public function is_plugin_active() { |
| 25 | return class_exists( 'Ninja_Forms' ); |
| 26 | } |
| 27 | |
| 28 | private function get_post_types() { |
| 29 | return [ 'nf_sub' ]; |
| 30 | } |
| 31 | |
| 32 | public function show_notice( Screen $screen ) { |
| 33 | return 'edit' === $screen->get_base() |
| 34 | && in_array( $screen->get_post_type(), $this->get_post_types() ); |
| 35 | } |
| 36 | |
| 37 | public function show_placeholder( ListScreen $list_screen ) { |
| 38 | return $list_screen instanceof ListScreenPost |
| 39 | && in_array( $list_screen->get_post_type(), $this->get_post_types() ); |
| 40 | } |
| 41 | |
| 42 | } |