Aggregate.php
3 days ago
BeaverBuilderGroups.php
3 days ago
BuddyPressGroups.php
3 days ago
DefaultGroups.php
3 days ago
EventsCalendarGroups.php
3 days ago
GravityFormsGroups.php
3 days ago
JetEngineGroups.php
3 days ago
MediaLibraryAssistantGroups.php
3 days ago
MetaBoxGroups.php
3 days ago
WooCommerceGroups.php
3 days ago
BeaverBuilderGroups.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Admin\MenuGroupFactory; |
| 6 | |
| 7 | use AC\Admin\MenuGroupFactory; |
| 8 | use AC\Admin\Type\MenuGroup; |
| 9 | use AC\PostType; |
| 10 | use AC\TableScreen; |
| 11 | use AC\Taxonomy; |
| 12 | |
| 13 | class BeaverBuilderGroups implements MenuGroupFactory |
| 14 | { |
| 15 | public function create(TableScreen $table_screen): ?MenuGroup |
| 16 | { |
| 17 | if ( |
| 18 | $table_screen instanceof PostType && |
| 19 | 'fl-builder-template' === (string)$table_screen->get_post_type() |
| 20 | ) { |
| 21 | return new MenuGroup( |
| 22 | 'beaver-builder', |
| 23 | __('Beaver Builder', 'codepress-admin-columns'), |
| 24 | 14, |
| 25 | 'dashicons-layout' |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | if ( |
| 30 | $table_screen instanceof Taxonomy && |
| 31 | 'fl-builder-template-category' === (string)$table_screen->get_taxonomy() |
| 32 | ) { |
| 33 | return new MenuGroup( |
| 34 | 'beaver-builder', |
| 35 | __('Beaver Builder', 'codepress-admin-columns'), |
| 36 | 14, |
| 37 | 'dashicons-layout' |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | return null; |
| 42 | } |
| 43 | |
| 44 | } |
| 45 |