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
MetaBoxGroups.php
31 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 | |
| 12 | class MetaBoxGroups implements MenuGroupFactory |
| 13 | { |
| 14 | public function create(TableScreen $table_screen): ?MenuGroup |
| 15 | { |
| 16 | if ( |
| 17 | $table_screen instanceof PostType && |
| 18 | in_array( |
| 19 | (string)$table_screen->get_post_type(), |
| 20 | ['meta-box', 'mb-taxonomy', 'mb-relationship', 'mb-post-type'], |
| 21 | true |
| 22 | ) |
| 23 | ) { |
| 24 | return new MenuGroup('metabox', 'MetaBox', 14); |
| 25 | } |
| 26 | |
| 27 | return null; |
| 28 | } |
| 29 | |
| 30 | } |
| 31 |