Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin
Table::prepare_items()
Prepare table list items.
Метод класса: Table{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Table = new Table(); $Table->prepare_items();
Код Table::prepare_items() Table::prepare items WC 9.2.3
public function prepare_items() { // phpcs:disable WordPress.Security.NonceVerification.Recommended // phpcs:disable WordPress.Security.NonceVerification.Missing $current_page = $this->get_pagenum(); $per_page = $this->get_items_per_page( 'edit_approved_directories_per_page' ); $search = sanitize_text_field( wp_unslash( $_REQUEST['s'] ?? '' ) ); switch ( $_REQUEST['view'] ?? '' ) { case 'enabled': $enabled = true; break; case 'disabled': $enabled = false; break; default: $enabled = null; break; } // phpcs:enable $approved_directories = wc_get_container()->get( Register::class )->list( array( 'page' => $current_page, 'per_page' => $per_page, 'search' => $search, 'enabled' => $enabled, ) ); $this->items = $approved_directories['approved_directories']; // Set the pagination. $this->set_pagination_args( array( 'total_items' => $approved_directories['total_urls'], 'total_pages' => $approved_directories['total_pages'], 'per_page' => $per_page, ) ); }