Skip to content

Instantly share code, notes, and snippets.

@sisaacrussell
Created July 14, 2022 01:48
Show Gist options
  • Save sisaacrussell/23a77bdbe0793b2884c923e140120fe3 to your computer and use it in GitHub Desktop.
Save sisaacrussell/23a77bdbe0793b2884c923e140120fe3 to your computer and use it in GitHub Desktop.
Change heading for "Expires:" column in the WooCommerce Memberships My Account members area.
<?php
// Only copy opening php tag if needed
/**
* Change heading for "Expires:" column in the WooCommerce Memberships My Account members area.
*
* @param array $columns Array of columns to display in membership area.
* @return $columns
*/
function sprucely_rename_membership_end_date_column( $columns ) {
$wcm_columns = $columns;
$new_end_date = array( 'membership-end-date' => _x( 'Expires', 'Membership end date', 'woocommerce-memberships' ) ); // Change Expires to whatever you want.
$columns = array_replace( $wcm_columns, $new_end_date );
return $columns;
}
add_filter( 'wc_memberships_my_memberships_column_names', 'sprucely_rename_membership_end_date_column' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment