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
BuddyPressGroups.php
47 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\TableScreen; |
| 10 | use AC\Type\TableId; |
| 11 | |
| 12 | class BuddyPressGroups implements MenuGroupFactory |
| 13 | { |
| 14 | public function create(TableScreen $table_screen): ?MenuGroup |
| 15 | { |
| 16 | $table_id = $table_screen->get_id(); |
| 17 | |
| 18 | if ( |
| 19 | $table_id->equals(new TableId('bp-groups')) || |
| 20 | $table_id->equals(new TableId('bp-activity')) || |
| 21 | $table_id->equals(new TableId('bp-email')) |
| 22 | ) { |
| 23 | return new MenuGroup( |
| 24 | 'buddypress', |
| 25 | __('BuddyPress'), |
| 26 | 22, |
| 27 | 'dashicons-buddicons-buddypress-logo' |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | if ( |
| 32 | $table_id->equals(new TableId('wp-taxonomy_bp_member_type')) || |
| 33 | $table_id->equals(new TableId('wp-taxonomy_bp_group_type')) |
| 34 | ) { |
| 35 | return new MenuGroup( |
| 36 | 'buddypress', |
| 37 | __('BuddyPress'), |
| 38 | 24, |
| 39 | 'dashicons-buddicons-buddypress-logo' |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | return null; |
| 44 | } |
| 45 | |
| 46 | } |
| 47 |