Skip to content

Instantly share code, notes, and snippets.

@Acephalia
Created April 7, 2023 04:50
Show Gist options
  • Select an option

  • Save Acephalia/b8982737fa0919d6ae894abd6b7b742e to your computer and use it in GitHub Desktop.

Select an option

Save Acephalia/b8982737fa0919d6ae894abd6b7b742e to your computer and use it in GitHub Desktop.
Woocommerce Rename ‘Length’ to ‘Depth’
add_filter( 'gettext', 'rename_length_to_depth', 20, 3 );
function rename_length_to_depth( $translated_text, $untranslated_text, $domain ) {
if ( $untranslated_text == 'Length' && $domain == 'woocommerce' ) {
$translated_text = 'Depth';
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment