Products
GG网络技术分享 2025-03-18 16:12 0
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 O
bject-O
riented P
rogramming --- 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 M
odel-V
iew-C
ontroller---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 .
Demand feedback