Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin

Table::column_title()publicWC 1.0

URL column.

{} Это метод класса: Table{}

Хуков нет.

Возвращает

Строку.

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

$Table = new Table();
$Table->column_title( $item );
$item(StoredUrl) (обязательный)
The approved directory information for the current row.

Код Table::column_title() WC 6.7.0

public function column_title( $item ) {
	$id      = (int) $item->get_id();
	$url     = esc_html( $item->get_url() );
	$enabled = $item->is_enabled();

	$edit_url            = esc_url( $this->get_action_url( 'edit', $id ) );
	$enable_disable_url  = esc_url( $enabled ? $this->get_action_url( 'disable', $id ) : $this->get_action_url( 'enable', $id ) );
	$enable_disable_text = esc_html( $enabled ? __( 'Disable', 'woocommerce' ) : __( 'Enable', 'woocommerce' ) );
	$delete_url          = esc_url( $this->get_action_url( 'delete', $id ) );
	$edit_link           = "<a href='{$edit_url}'>" . esc_html_x( 'Edit', 'Product downloads list', 'woocommerce' ) . '</a>';
	$enable_disable_link = "<a href='{$enable_disable_url}'>{$enable_disable_text}</a>";
	$delete_link         = "<a href='{$delete_url}' class='submitdelete wc-confirm-delete'>" . esc_html_x( 'Delete permanently', 'Product downloads list', 'woocommerce' ) . '</a>';
	$url_link            = "<a href='{$edit_url}'>{$url}</a>";

	return "
		<strong>{$url_link}</strong>
		<div class='row-actions'>
			<span class='id'>ID: {$id}</span> |
			<span class='edit'>{$edit_link}</span> |
			<span class='enable-disable'>{$enable_disable_link}</span> |
			<span class='delete'><a class='submitdelete'>{$delete_link}</a></span>
		</div>
	";
}