1 回答
TA贡献1816条经验 获得超4个赞
在order/order-downloads.php
模板文件中,以下内容应用于第30行
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
wc_get_account_downloads_columns()
指第234wc-account-functions.php
行
/**
* Get My Account > Downloads columns.
*
* @since 2.6.0
* @return array
*/
function wc_get_account_downloads_columns() {
$columns = apply_filters(
'woocommerce_account_downloads_columns',
array(
'download-product' => __( 'Product', 'woocommerce' ),
'download-remaining' => __( 'Downloads remaining', 'woocommerce' ),
'download-expires' => __( 'Expires', 'woocommerce' ),
'download-file' => __( 'Download', 'woocommerce' ),
'download-actions' => ' ',
)
);
if ( ! has_filter( 'woocommerce_account_download_actions' ) ) {
unset( $columns['download-actions'] );
}
return $columns;
}
因此,要回答您的问题,您可以应用以下内容
function filter_woocommerce_account_downloads_columns( $columns ) {
$columns['download-file'] = __( 'New name', 'woocommerce');
return $columns;
}
add_filter( 'woocommerce_account_downloads_columns', 'filter_woocommerce_account_downloads_columns', 10, 1 );
- 1 回答
- 0 关注
- 124 浏览
添加回答
举报