WC_Admin_List_Table::maybe_render_blank_state()publicWC 1.0

Show blank slate.

Method of the class: WC_Admin_List_Table{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_List_Table = new WC_Admin_List_Table();
$WC_Admin_List_Table->maybe_render_blank_state( $which );
$which(string) (required)
String which tablenav is being shown.

WC_Admin_List_Table::maybe_render_blank_state() code WC 8.7.0

public function maybe_render_blank_state( $which ) {
	global $post_type;

	if ( $post_type === $this->list_table_type && 'bottom' === $which ) {
		$counts = (array) wp_count_posts( $post_type );
		unset( $counts['auto-draft'] );
		$count = array_sum( $counts );

		if ( 0 < $count ) {
			return;
		}

		$this->render_blank_state();

		echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions, .wrap .subsubsub  { display: none; } #posts-filter .tablenav.bottom { height: auto; } </style>';
	}
}