Automattic\WooCommerce\Internal\Admin\Orders

ListTable::should_render_blank_state()privateWC 1.0

Checks whether the blank state should be rendered or not. This depends on whether there are others with a visible status.

Method of the class: ListTable{}

Return

true|false. TRUE when the blank state should be rendered, FALSE otherwise.

Usage

// private - for code of main (parent) class only
$result = $this->should_render_blank_state(): bool;

ListTable::should_render_blank_state() code WC 8.7.0

private function should_render_blank_state(): bool {
	/**
	 * Whether we should render a blank state so that custom count queries can be used.
	 *
	 * @since 8.6.0
	 *
	 * @param null           $should_render_blank_state `null` will use the built-in counts. Sending a boolean will short-circuit that path.
	 * @param object         ListTable The current instance of the class.
	*/
	$should_render_blank_state = apply_filters(
		'woocommerce_' . $this->order_type . '_list_table_should_render_blank_state',
		null,
		$this
	);

	if ( is_bool( $should_render_blank_state ) ) {
		return $should_render_blank_state;
	}

	return ( ! $this->has_filter ) && 0 === $this->count_orders_by_status( array_keys( $this->get_visible_statuses() ) );
}