duansha3771 2017-07-28 11:31
浏览 54
已采纳

开发Wordpress插件设置页面程序或OOP?

Is it a problem develop wordpress settings page in html? When i search the internet and github, i found (almost) tutorials how build a settings page in OOP.

I have a book 'Wordpress Plugin Development' https://www.amazon.com/Professional-WordPress-Plugin-Development-Williams/dp/0470916222 but is a bit outdated (print in 2011) and i don't know if some functions are depricated.

I have also the book 'Pro Wordpress Design and Development', print in 2015. In the last book they build a settings page NOT in OOP, but build in html.

Is it a problem building a settings-page with html and not in OOP? Is this future-proof?

  • 写回答

3条回答 默认 最新

  • doudao9915 2017-07-28 11:45
    关注

    If you are developing a Plugin, most places I have read recomend to go OOP, if you are developing a theme or for a theme, the recomendation is to go with pluiggable functions. This is functios wrapped in an if that determines if the function has already been defined, anybody can later on override you function, normally in the functions.php script.

    Now for plugins there are some skeletons or boilerplate that using oop separate admin functions from public functions, and also separate logic from presentation. And also put hooks all in the same place. You can search a bit on this a find one you feel confortable with.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥35 spaceclaim脚本
  • ¥15 MC9S12XS128单片机实验
  • ¥15 失败的github程序安装
  • ¥15 WSL上下载的joern在windows怎么用?
  • ¥15 jetson nano4GB
  • ¥15 电脑回复出厂设置,重装过程报错提示,求解决方案Windows 无法分析或处理无人参与应答文件 [C:\WINDOWS\Panther\unattend.xml,如何解决?
  • ¥15 进入lighttools中的UDOP编辑器的方法
  • ¥15 求Gen6d训练数据集
  • ¥20 liunx中winscp中可以登入ftp,但是不能登入sftp,如何解决
  • ¥15 lighttools的光学属性自定义的用法流程
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部