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 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助