WC_Admin_Webhooks::table_list_output()private staticWC 1.0

Table list output.

Метод класса: WC_Admin_Webhooks{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WC_Admin_Webhooks::table_list_output();

Код WC_Admin_Webhooks::table_list_output() WC 8.7.0

<?php
private static function table_list_output() {
	global $webhooks_table_list;

	echo '<h2 class="wc-table-list-header">' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ) . '" class="page-title-action">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';

	// Get the webhooks count.
	$data_store   = WC_Data_Store::load( 'webhook' );
	$num_webhooks = $data_store->get_count_webhooks_by_status();
	$count        = array_sum( $num_webhooks );

	if ( 0 < $count ) {
		$webhooks_table_list->process_bulk_action();
		$webhooks_table_list->prepare_items();

		echo '<input type="hidden" name="page" value="wc-settings" />';
		echo '<input type="hidden" name="tab" value="advanced" />';
		echo '<input type="hidden" name="section" value="webhooks" />';

		$webhooks_table_list->views();
		$webhooks_table_list->search_box( __( 'Search webhooks', 'woocommerce' ), 'webhook' );
		$webhooks_table_list->display();
	} else {
		echo '<div class="woocommerce-BlankState woocommerce-BlankState--webhooks">';
		?>
		<h2 class="woocommerce-BlankState-message"><?php esc_html_e( 'Webhooks are event notifications sent to URLs of your choice. They can be used to integrate with third-party services which support them.', 'woocommerce' ); ?></h2>
		<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ); ?>"><?php esc_html_e( 'Create a new webhook', 'woocommerce' ); ?></a>
		<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; }</style>
		<?php
	}
}