站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Migrating Plugins and Themes to 2.5
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
===管理界面=== Any plugin that had added a section to the post editing screen, or other administration screen, will probably find that the formatting and markup changes on the administration screens in WordPress 2.5 have made their section so that it no longer "blends in" and looks like it belongs with the built-in WordPress sections on the screen. Also, some of the [[WordPress:Plugin API|hooks]] that plugins would have used in versions 2.3 and earlier to add information to various screens have been removed, in favor of a new API which uses the function [[WordPress:Function_Reference/add_meta_box|add_meta_box]] to define a section that can be added to the post, page, or link editing screen. (Until this function has its own documentation page, you can find it, and its documentation header, in <tt>wp-admin/includes/template.php</tt>). 任何将部分添加到文本编辑界面或者其它管理界面的插件,可能发现WordPress2.5版本中格式和标记的变化使得它们的部分不再"调和" 而且看起来像是界面上内置的WordPress部分。同时插件在2.3版本以及更早的版本中使用的一些用于向各种界面添加信息的[[WordPress:Plugin API|hooks]]已经被移除,有利于新的使用函数 [[WordPress:Function_Reference/add_meta_box|add_meta_box]]定义可以添加到文章,页面或者链接编辑界面的部分的API。(只有这个函数拥有自已的文档页面,你才可以找到,它的文档标题,在<tt>wp-admin/includes/template.php</tt>中)。 So, plugin authors will either need to release a new version of their plugins for WordPress 2.5, or (preferably) put some decision logic into their plugin that will detect the version and use the right formatting. A good way to do that is to detect whether the new function <tt>add_meta_box</tt> has been defined. For example: <pre> if (function_exists('add_meta_box')) { // 2.5 logic, calling add_meta_box to define the screen } else { // 2.3 logic, calling add_action( 'dbx_post_advanced' ) or similar } </pre> 因此,插件作者需要为WordPress2.5版本发行一个新的插件,或者(更适宜)在插件中置入一些决定逻辑,使得插件能够探测版本并且使用不同的格式。更好的方法是侦测是否定义了新的函数<tt>add_meta_box</tt>。如: <pre> if (function_exists('add_meta_box')) { // 2.5 logic, calling add_meta_box 定义界面 } else { // 2.3 logic, calling add_action( 'dbx_post_advanced' ) 或者类似的 } </pre> Note: Be sure to run the function_exists test late in the WordPress initialization process! That function is not loaded at the time of plugin initialization. So it is suggested that you do this inside of an 'admin_menu' action, or the new 'admin_init' action. 注意:在稍后WordPress初始化过程中确定运行了function_exists测试!这个函数不是在插件初始化的时候载入的。因此,建议你在'admin_menu' action或者新的'admin_init' action内容操作。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)