TableScreen
3 months ago
ColumnTypesFactory.php
3 months ago
ListTable.php
3 months ago
MediaLibraryAssistant.php
3 months ago
TableIdsFactory.php
3 months ago
TableScreen.php
3 months ago
TableScreenFactory.php
3 months ago
WpListTableFactory.php
3 months ago
WpListTableFactory.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\ThirdParty\MediaLibraryAssistant; |
| 6 | |
| 7 | use MLA_List_Table; |
| 8 | |
| 9 | /** |
| 10 | * Load the list table specifically for export. This will |
| 11 | * initiate the needed hooks (e.g. mla_list_table_query_final_terms) a bit earlier, and it |
| 12 | * will prevent the "headers already set" message. |
| 13 | */ |
| 14 | class WpListTableFactory |
| 15 | { |
| 16 | |
| 17 | public function create(): MLA_List_Table |
| 18 | { |
| 19 | global $wp_list_table; |
| 20 | |
| 21 | if ( ! class_exists('MLA_List_Table')) { |
| 22 | require_once(MLA_PLUGIN_PATH . 'includes/class-mla-list-table.php'); |
| 23 | MLA_List_Table::mla_admin_init_action(); |
| 24 | } |
| 25 | |
| 26 | if ($wp_list_table instanceof MLA_List_Table) { |
| 27 | return $wp_list_table; |
| 28 | } |
| 29 | |
| 30 | $list_table = new MLA_List_Table(); |
| 31 | $list_table->prepare_items(); |
| 32 | |
| 33 | return $list_table; |
| 34 | } |
| 35 | |
| 36 | } |