WC_Admin_Webhooks_Table_List::column_title
Return title column.
Метод класса: WC_Admin_Webhooks_Table_List{}
Хуки из метода
Возвращает
Строку.
Использование
$WC_Admin_Webhooks_Table_List = new WC_Admin_Webhooks_Table_List(); $WC_Admin_Webhooks_Table_List->column_title( $webhook );
- $webhook(WC_Webhook) (обязательный)
- Webhook instance.
Код WC_Admin_Webhooks_Table_List::column_title() WC Admin Webhooks Table List::column title WC 10.3.5
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.
$warning_prefix =
$this->uses_legacy_rest_api( $webhook ) && ! WC()->legacy_rest_api_is_available() ?
sprintf(
"<span title='%s'>⚠️</span>️ ",
esc_html__( 'This webhook is configured to be delivered using the Legacy REST API, but the Legacy REST API plugin is not installed on this site.', 'woocommerce' )
) : '';
$output .= '<strong>' . $warning_prefix . '<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§ion=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;
}