Automattic\WooCommerce\Internal\Admin\Orders
ListTable::should_render_blank_state
Checks whether the blank state should be rendered or not. This depends on whether there are others with a visible status.
Метод класса: ListTable{}
Возвращает
true|false. TRUE when the blank state should be rendered, FALSE otherwise.
Использование
// private - только в коде основоного (родительского) класса $result = $this->should_render_blank_state(): bool;
Код ListTable::should_render_blank_state() ListTable::should render blank state WC 10.3.5
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() ) );
}