Automattic\WooCommerce\Internal\Admin\Logging
PageController::setup_screen_options
Register screen options for the logging views.
Method of the class: PageController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$PageController = new PageController(); $PageController->setup_screen_options( $view ): void;
- $view(string) (required)
- The current view within the Logs tab.
PageController::setup_screen_options() PageController::setup screen options code WC 10.3.6
public function setup_screen_options( string $view ): void {
$handler = $this->settings->get_default_handler();
$list_table = null;
switch ( $handler ) {
case LogHandlerFileV2::class:
if ( in_array( $view, array( 'list_files', 'search_results' ), true ) ) {
$list_table = $this->get_list_table( $view );
}
break;
case 'WC_Log_Handler_DB':
$list_table = WC_Admin_Status::get_db_log_list_table();
break;
}
if ( $list_table instanceof WP_List_Table ) {
// Ensure list table columns are initialized early enough to enable column hiding, if available.
$list_table->prepare_column_headers();
add_screen_option(
'per_page',
array(
'default' => $list_table->get_per_page_default(),
'option' => $list_table::PER_PAGE_USER_OPTION_KEY,
)
);
}
}