WooCommerce: change form labels on registration pa

2019-08-28 03:31发布

问题:

I'm trying to find the Hook to edit the form label on woocommarce restration page (/my-account/) without luck. I want to add to functions.php what to change username label to. Username to: Username more text

I do not want to edit template files. Any ide what to do?

回答1:

Unfortunately the login form labels aren't filterable. You will need to override the my-account/form-login.php template in your theme and make your edits there.



回答2:

You will need to look and find out is the hook for your described text to change to your custom value. A list of all the hooks:

http://docs.woothemes.com/wc-apidocs/hook-docs.html

Once you locate the correct hook you can use the add_filer() to return the new text of Username eg.

Optionaly, you can look into the css :after selector to add some text, hoever this is a hack. These are the only way's withing using template files.