WordPress插件开发 [英] WordPress Plugin Development

查看:67
本文介绍了WordPress插件开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了 CODEX 之外,您还推荐哪些资源来帮助创建插件的新手帮助创建 WordPress 插件.我有一个想法,但需要比 CODEX 中的内容更好的解释才能开始.

Besides the CODEX what resources do you recommend to help a person new to creating plugins help create a WordPress plugin. I have an idea, but need a bit better explanation than what is in the CODEX to get started.

更新:我可以买一本书来帮助我解决这个问题吗?

UPDATE: Is there a book that I could buy to help me out with this?

推荐答案

写完 MyBlogLog 插件(原来的插件)后,我发现 Wordpress Hooks 列表(不记得链接)非常有用,Codex 和 WP Install 文件中的示例代码也是如此.通读其他开发者的插件也是一种很好的学习方式,因为您可以了解他们是如何实现的,并使用这些技术为自己节省一些研发时间.

Having written the MyBlogLog plugin (the original one, that is) I found that the Wordpress Hooks list (can't remember the link offhand) was incredibly useful, as was the sample code from the Codex and WP Install files. Reading through other developer's plugins is also a good way to learn, as you can see how they implemented things and use those techniques to save yourself some R&D time.

无论如何,你想创造什么?

What are you looking to create, anyways?

我对此发表了评论,但以防万一它丢失...

I posted a comment with this, but just in case it gets lost...

对于您的特定需求,您将希望存储数据并能够管理和检索数据,因此您需要在插件中创建自定义数据库表.请参阅此代码链接:

For your specific needs, you're going to want to store data and be able to manage and retrieve it so creating a custom database table in your plugin is something you will want to do. See this codex link:

http://codex.wordpress.org/Creating_Tables_with_Plugins

然后您可以使用此 Codex 页面上的技术将您的管理代码添加到管理屏幕中:

Then you can just add your management code into the admin screens using the techniques found on this Codex page:

http://codex.wordpress.org/Adding_Administration_Menus

如果你想在页面上显示项目,你可以自己编写一个自定义的 PHP WP 页面模板来直接查询数据库:

If you want to display the items on a page, you can either write yourself a custom PHP WP Page template to query the DB directly:

http://codex.wordpress.org/Pages#Page_Templates

或者只是在您的插件上添加一个钩子过滤器,根据您指定的关键字将结果写入页面:

Or just add a hook filter on your plugin to write the results to the page based on a keyword you specify:

http://codex.wordpress.org/Plugin_API#Filters

这篇关于WordPress插件开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆