admin管理员组文章数量:1129424
I've added a new tab into my "My-account" page on woocommerce using a hybrid of the following:
New Tab: Woocommerce add new tab to account page
New Content to tab: Add content to tab
I've been successful with this and it is working great, the new tab is there and so is the relevant content.
The issue I have is that the "Save Changes" button doesn't appear at the bottom of the new tab. I think I could probably hack around at the PHP code (copy the source code for the button from abother tab) to get the button in place - but I want to learn the correct way to do this.
Could anyone please give me some pointers?
Thanks Chris
I've added a new tab into my "My-account" page on woocommerce using a hybrid of the following:
New Tab: Woocommerce add new tab to account page
New Content to tab: Add content to tab
I've been successful with this and it is working great, the new tab is there and so is the relevant content.
The issue I have is that the "Save Changes" button doesn't appear at the bottom of the new tab. I think I could probably hack around at the PHP code (copy the source code for the button from abother tab) to get the button in place - but I want to learn the correct way to do this.
Could anyone please give me some pointers?
Thanks Chris
Share Improve this question asked Apr 7, 2020 at 9:33 Walshie1987Walshie1987 1092 bronze badges 2- Hi, welcome to WordPress Development. As a rule, the community considers questions about third-party plugins (such as woocommerce) off-topic so you might notice some down-votes and answers may be slow if they come at all. You can find out what questions are a good fit here. – Matthew Brown aka Lord Matt Commented Apr 7, 2020 at 13:06
- 1 Thanks Matt, appreciate the tip, I'll check out the link – Walshie1987 Commented Apr 7, 2020 at 13:39
1 Answer
Reset to default 0Basically, if you output your custom form fields on a custom My Account tab, it means you're outside of my account form territory - you should wrap the fields in their own custom form (tag), and you also need a form handler function.
You can see an example implementation here - and you can find a relevant StackOverflow topic with a more detailed explanation here (I used this SO answer to write the afore-mentioned gist).
本文标签: customizationWoocommerce custom quotMy Accountquot TabAdd Save button
版权声明:本文标题:customization - Woocommerce custom "My Account" Tab - Add Save button 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736745432a1950749.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论