WordPress at Your Fingertips
function is not described

WC_Admin_Webhooks_Table_List::prepare_items() public WC 1.0

Prepare table list items.

{} It's a method of the class: WC_Admin_Webhooks_Table_List{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Webhooks_Table_List = new WC_Admin_Webhooks_Table_List();
$WC_Admin_Webhooks_Table_List->prepare_items();

Code of WC_Admin_Webhooks_Table_List::prepare_items() WC 5.9.0

public function prepare_items() {
	$per_page     = $this->get_items_per_page( 'woocommerce_webhooks_per_page' );
	$current_page = $this->get_pagenum();

	// Query args.
	$args = array(
		'limit'  => $per_page,
		'offset' => $per_page * ( $current_page - 1 ),
	);

	// Handle the status query.
	if ( ! empty( $_REQUEST['status'] ) ) { // WPCS: input var okay, CSRF ok.
		$args['status'] = sanitize_key( wp_unslash( $_REQUEST['status'] ) ); // WPCS: input var okay, CSRF ok.
	}

	if ( ! empty( $_REQUEST['s'] ) ) { // WPCS: input var okay, CSRF ok.
		$args['search'] = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // WPCS: input var okay, CSRF ok.
	}

	$args['paginate'] = true;

	// Get the webhooks.
	$data_store  = WC_Data_Store::load( 'webhook' );
	$webhooks    = $data_store->search_webhooks( $args );
	$this->items = array_map( 'wc_get_webhook', $webhooks->webhooks );

	// Set the pagination.
	$this->set_pagination_args(
		array(
			'total_items' => $webhooks->total,
			'per_page'    => $per_page,
			'total_pages' => $webhooks->max_num_pages,
		)
	);
}