admin管理员组文章数量:1432213
I'm looking for how to code custom "special" page as use many plugins. An idea is that I have in theme links to the custom special page. Then admin can chose which of his pages is the one "special" page.
The functionality I'm looking for is similar as functionality of for example "Shop page" in woocommerce.
I appreciate any help or a documentation link.
I'm looking for how to code custom "special" page as use many plugins. An idea is that I have in theme links to the custom special page. Then admin can chose which of his pages is the one "special" page.
The functionality I'm looking for is similar as functionality of for example "Shop page" in woocommerce.
I appreciate any help or a documentation link.
Share Improve this question asked Apr 27, 2019 at 9:47 Tomáš VavřinkaTomáš Vavřinka 1979 bronze badges 1- Possible duplicate of How to create a Page alias in WordPress – Jacob Peattie Commented Apr 29, 2019 at 7:33
1 Answer
Reset to default 1Because you asked "How to Code", here is my guide to get you started.
- Create a menu page in the administration area using add_menu_page
- Create the form using html select form-element
- Populate the form-element with all pages. To get all pages you can use get_posts()
- Save the form using admin_post action
- Save the selected-item of the form using update_option()
- To get the saved option you can use get_option()
- To add that — Special Text in the page list, you need to filter the title. If the page's ID is equal to the saved_setting, then append that text. I'm not sure which hook to use, I think it is manage_pages_columns
I hope it helps.
本文标签: theme developmentHow to code custom special page
版权声明:本文标题:theme development - How to code custom special page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745546587a2662731.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论