duansha3771 2017-07-28 19: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 19: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条)

报告相同问题?

悬赏问题

  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块