GG资源网

开发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?

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~
功能建议

在html中开发wordpress设置页面是否有问题?
当我搜索互联网和github时,我发现(几乎 教程如何在OOP中构建设置页面。</ p>

我有一本书\'WordPress插件开发\' https://www.amazon.com/Professional-WordPress-Plugin-Development-Williams/dp/0470916222 但有点过时(2011年打印)我不喜欢 不知道某些功能是否被删除。</ p>

我还有“Pro WordPress设计与开发”一书,于2015年打印。
在上一本书中,他们构建了一个不在OOP中的设置页面 ,但是用html构建。</ p>

使用html而不是在OOP中构建设置页面是否有问题?
这是否适合未来发展?</ p>
</ div>

网友观点:

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.

###

In the body of your question, you are talking about two different things... html is a client side language where as OOP stands for Object-Oriented Programming --- which is a programming paradigm and has it\'s applications in languages such as Java, Python, Ruby, etc.

PHP on the other hand, allows one to program either procedurally or OOP

So the question is not which to pick... it\'s whatever style you are comfortable with (I recommend going the OOP route).

Lastly, which ever you pick, you will be writing HTML for things like radio buttons, input boxes, etc. on the settings view. And speaking of views, if you go the MVC route (which stands for Model-View-Controller---which is an architectural pattern---your HTML will be inside the View

###

It will be best , if you will go to build WP plugin through OOPS . Because you don’t really have to worry about clashing with functions defined elsewhere .

由于网站搬家,部分链接失效,如无法下载,请联系站长!谢谢支持!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 开发WordPress插件设置页面程序或OOP?

发表回复

CAPTCHAis initialing...