WC_Admin_Webhooks_Table_List::column_title()publicWC 1.0

Return title column.

Method of the class: WC_Admin_Webhooks_Table_List{}

Hooks from the method

Return

String.

Usage

$WC_Admin_Webhooks_Table_List = new WC_Admin_Webhooks_Table_List();
$WC_Admin_Webhooks_Table_List->column_title( $webhook );
$webhook(WC_Webhook) (required)
Webhook instance.

WC_Admin_Webhooks_Table_List::column_title() code WC 8.7.0

public function column_title( $webhook ) {
	$edit_link = admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=' . $webhook->get_id() );
	$output    = '';

	// Title.
	$output .= '<strong><a href="' . esc_url( $edit_link ) . '" class="row-title">' . esc_html( $webhook->get_name() ) . '</a></strong>';

	// Get actions.
	$actions = array(
		/* translators: %s: webhook ID. */
		'id'     => sprintf( __( 'ID: %d', 'woocommerce' ), $webhook->get_id() ),
		'edit'   => '<a href="' . esc_url( $edit_link ) . '">' . esc_html__( 'Edit', 'woocommerce' ) . '</a>',
		/* translators: %s: webhook name */
		'delete' => '<a class="submitdelete" aria-label="' . esc_attr( sprintf( __( 'Delete "%s" permanently', 'woocommerce' ), $webhook->get_name() ) ) . '" href="' . esc_url(
			wp_nonce_url(
				add_query_arg(
					array(
						'delete' => $webhook->get_id(),
					),
					admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks' )
				),
				'delete-webhook'
			)
		) . '">' . esc_html__( 'Delete permanently', 'woocommerce' ) . '</a>',
	);

	$actions     = apply_filters( 'webhook_row_actions', $actions, $webhook );
	$row_actions = array();

	foreach ( $actions as $action => $link ) {
		$row_actions[] = '<span class="' . esc_attr( $action ) . '">' . $link . '</span>';
	}

	$output .= '<div class="row-actions">' . implode( ' | ', $row_actions ) . '</div>';

	return $output;
}