WooCommerce: change form labels on registration page

牧云@^-^@ 提交于 2019-12-13 04:54:51

问题


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.



来源:https://stackoverflow.com/questions/29595237/woocommerce-change-form-labels-on-registration-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!