WordPress: Migrating Plugins and Themes to 2.1:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: ==Introduction== When a new major version of WordPress is released, such as WordPress 2.1 or 2.2, you may find that your Themes and Plugins no longer work the way you are used to. It cou...)
 
无编辑摘要
第1行: 第1行:
==Introduction==
==Introduction==
==介绍==


When a new major version of WordPress is released, such as WordPress 2.1 or 2.2, you may find that your Themes and Plugins no longer work the way you are used to. It could be that they are completely broken, because something in WordPress that was fundamental to them changed, but it's also possible that you can get them working again by updating some settings, or maybe just a small edit.  
When a new major version of WordPress is released, such as WordPress 2.1 or 2.2, you may find that your Themes and Plugins no longer work the way you are used to. It could be that they are completely broken, because something in WordPress that was fundamental to them changed, but it's also possible that you can get them working again by updating some settings, or maybe just a small edit.  
发行一个新的主要版本的WordPress,如WordPress2.1或者2.2,你可能发现你的主题和插件不再向以前那样运行。可能因为插件和主题完全毁坏了,因为WordPress中对它们而言至关重要的部分更改了,但是通过上传一些设置,或者只是简单地编辑一下,你可能有能够使得这些插件和主题正常运行。


This article is part of a series on [[WordPress:Migrating Plugins and Themes]]. It covers changes between WordPress Version 2.0 and [http://wordpress.org/development/2007/01/ella-21/ Version 2.1], and what you need to do to Plugins and Themes to get them working in Version 2.1.
This article is part of a series on [[WordPress:Migrating Plugins and Themes]]. It covers changes between WordPress Version 2.0 and [http://wordpress.org/development/2007/01/ella-21/ Version 2.1], and what you need to do to Plugins and Themes to get them working in Version 2.1.
这篇文章是[[WordPress:Migrating Plugins and Themes|转移插件和主题]]的一部分。包括WordPress2.0版本和[http://wordpress.org/development/2007/01/ella-21/ 2.1版本]之间的变化,你需要做的就是,使得插件和主题能够在2.1版本中运行。


If the Theme or Plugin you are using was developed by someone else, there are several places to look for information:
If the Theme or Plugin you are using was developed by someone else, there are several places to look for information:
如果你使用的主题或者插件是其他人开发的,你可以从下面的这些地点查找信息:
* Your Plugin or Theme's home page
* Your Plugin or Theme's home page
*你的插件或者主题的主页
* WordPress 2.1 [[WordPress:Plugins/Plugin_Compatibility/2.1|Plugin Compatibility List]]
* WordPress 2.1 [[WordPress:Plugins/Plugin_Compatibility/2.1|Plugin Compatibility List]]
* WordPress 2.1 [[WordPress:Plugins/Plugin_Compatibility/2.1|插件兼容性列表]]
* WordPress 2.1 [[WordPress:Themes/Theme_Compatibility/2.1|Theme Compatibility List]]
* WordPress 2.1 [[WordPress:Themes/Theme_Compatibility/2.1|Theme Compatibility List]]
* WordPress 2.1 [[WordPress:Themes/Theme_Compatibility/2.1|主题兼容性列表]]


If you are the author of your Theme or Plugin, or if you have modified or customized your Theme, then this article will help you upgrade your Theme/Plugin for 2.1. If your Theme or Plugin is distributed publicly, after getting it working you may want to add it to the Compatibility lists above, so your users will know it is working and which version they should be running.
If you are the author of your Theme or Plugin, or if you have modified or customized your Theme, then this article will help you upgrade your Theme/Plugin for 2.1. If your Theme or Plugin is distributed publicly, after getting it working you may want to add it to the Compatibility lists above, so your users will know it is working and which version they should be running.
如果你是主题或者插件的作者,或者如果你更改或者自定义了主题,那么这篇文章会帮助你将主题/插件升级到2.1。如果你的主题或者插件是公开发行的版本,使得插件和主题运行之后,你希望将插件或者主题添加到上述的兼容性列表,这样你的用户会了解这些插件或者主题在运行以及应该在哪个版本上运行。


==Fixing Up Your Theme or Plugin==
==Fixing Up Your Theme or Plugin==
==修理你的主题或者插件==


The starting point for upgrading your Theme or Plugin is to understand the changes to WordPress in Version 2.1. There is an overview of the changes in the [http://wordpress.org/development/2007/01/ella-21/ WordPress Development Blog article on the release of Version 2.1]. If your plugin or theme was relying on a feature that has changed, you may need to re-think it completely.  
The starting point for upgrading your Theme or Plugin is to understand the changes to WordPress in Version 2.1. There is an overview of the changes in the [http://wordpress.org/development/2007/01/ella-21/ WordPress Development Blog article on the release of Version 2.1]. If your plugin or theme was relying on a feature that has changed, you may need to re-think it completely.  
要升级你的主题或者插件,首先要了解2.1版本中WordPress发生的变化。在[http://wordpress.org/development/2007/01/ella-21/ WordPress 开发博客上关于2.1版本的文章]上有2.1版本的变化概述。如果你的插件或者主题依赖与已经发生了变化的功能,你可能需要完全地重新考虑是否使用这样的插件或主题。


===Core WordPress Database Changes===
===Core WordPress Database Changes===


=== WordPress 核心数据库变化===
One fairly significant change in WordPress Version 2.1 is the WordPress database structure. The main change is that in version 2.1, the categories for links (i.e. blogroll) and posts have been combined into one table. So, if your plugin does something special with the link or post category tables, you may need to modify it.  
One fairly significant change in WordPress Version 2.1 is the WordPress database structure. The main change is that in version 2.1, the categories for links (i.e. blogroll) and posts have been combined into one table. So, if your plugin does something special with the link or post category tables, you may need to modify it.  
WordPress2.1版本中一个相当重要的变化是WordPress数据库结构发生变化。主要的变化是在2.1版本中,链接的类别(如友情链接)和文章的类别结合到一个表格中。因此,如果你的插件处理有关链接或者文章类别表格方面的内容,你可能就要修改插件。


Also, when a user upgrades from a previous version, the upgrade script will take their blogroll categories and merge them into the post category table. Since you cannot now have a post category and a blogroll category with the same ID numbers, the result is that the blogroll category ID numbers will all change during the update. So, if you have a Theme or Plugin that does something special with a particular blogroll category, by knowing its ID number, you will need to change the ID number(s) cited in the Theme or Plugin to the new ID numbers. To see what the current numbers are, go to the Categories section of the Manage panel in WordPress, and they will be listed in the table there.  
Also, when a user upgrades from a previous version, the upgrade script will take their blogroll categories and merge them into the post category table. Since you cannot now have a post category and a blogroll category with the same ID numbers, the result is that the blogroll category ID numbers will all change during the update. So, if you have a Theme or Plugin that does something special with a particular blogroll category, by knowing its ID number, you will need to change the ID number(s) cited in the Theme or Plugin to the new ID numbers. To see what the current numbers are, go to the Categories section of the Manage panel in WordPress, and they will be listed in the table there.  
同时,用户从先前的版本升级的时候,升级脚本会将友情链接类别合并到文章类别表格。因为你现在不能够使得文章类别和友情链接类别的ID数字相同,更新的时候,友情链接类别ID数字会在更新过程中完全更改。因此,如果你有个插件或者主题通过了解友情链接类别的ID处理友情链接类别,你需要将主题或者插件中引用的ID数字更改为新的ID数字。想看看当前的数字是多少,只要进入WordPress管理面板中的类别部分,这些数字都列在那里的表格中。


Another database change is that the WordPress "posts" table now has a new field called "post_type", which you can use in your Plugin to distinguish better between Posts and Pages. This will not cause any compatibility problems, but you might want to use it in your Plugin to improve its logic.
Another database change is that the WordPress "posts" table now has a new field called "post_type", which you can use in your Plugin to distinguish better between Posts and Pages. This will not cause any compatibility problems, but you might want to use it in your Plugin to improve its logic.
数据库发生的另一个变化是WordPress "文章"表格中现在有个新的栏,称为"post_type",你可以在你的插件中使用这个栏,更好的区别文章和页面。这样做不会导致任何兼容性问题,但是你可能希望在插件中使用这一栏,提高插件的逻辑。


===Core WordPress File Changes===
===Core WordPress File Changes===
=== WordPress 核心文件变化===


Many of the core WordPress files were either reorganized or had their names changed between Version 2.0.x and 2.1. For most Themes and Plugins, this is not a problem, but some Plugins that need access to a particular WordPress function may be loading a specific PHP file name, in order to make sure that that function is defined. If the function you are using is located in a new file now, you'll need to change the reference.  
Many of the core WordPress files were either reorganized or had their names changed between Version 2.0.x and 2.1. For most Themes and Plugins, this is not a problem, but some Plugins that need access to a particular WordPress function may be loading a specific PHP file name, in order to make sure that that function is defined. If the function you are using is located in a new file now, you'll need to change the reference.  
从2.0.x升级到2.1版本,许多WordPress核心文件进行了重组或者更改了名称。对于大多数主题和插件而言,这不是个问题,但是一些需要访问WordPress特别函数可能需要载入特别的PHP文件名称,以确定函数已经定义。如果你使用的函数现在位于新的文件了,你就需要更改reference。


===Deprecated Functions and Variables===
===Deprecated Functions and Variables===
===已取消的函数和变数===


Some Plugins and Themes may be using functions and global variables that are "deprecated", which means that they were present in previous versions of WordPress, but are being phased out. They could be deleted in a future version of WordPress, without warning, and then your Plugin or Theme would stop working.
Some Plugins and Themes may be using functions and global variables that are "deprecated", which means that they were present in previous versions of WordPress, but are being phased out. They could be deleted in a future version of WordPress, without warning, and then your Plugin or Theme would stop working.
一些插件和主题可能使用"已取消"的函数和全局变数,意思是这些函数出现在先前的WordPress版本中,但是现在已经取消了。也可能在你得不到提醒的情况下,这些函数和全局变数在下一个版本中已经删除了,那么你的插件或者主题就会停止运行。


So, It is a good idea to check your Themes and Plugins for these functions, and make a substitution. Here is a (hopefully complete) list of deprecated functions (including ones deprecated in previous versions of WordPress). Replacement suggestions are also included (if they are missing and you know what they should be, feel free to jump in and edit!):
So, It is a good idea to check your Themes and Plugins for these functions, and make a substitution. Here is a (hopefully complete) list of deprecated functions (including ones deprecated in previous versions of WordPress). Replacement suggestions are also included (if they are missing and you know what they should be, feel free to jump in and edit!):
因此,为你的插件和主题,核查一下这些函数,很有必要,可以使用一些替代函数。下面是已取消的函数列表(希望完整)(包括那些在WordPress先前的版本中已取消的函数)。也包含了替换后的函数(如果缺少这些函数,你知道什么函数适合,可以加入编辑!)
* dropdown_cats
* dropdown_cats
* get_archives (use [[WordPress:Template_Tags/wp_get_archives|wp_get_archives]])
* get_archives (use [[WordPress:Template_Tags/wp_get_archives|wp_get_archives]])
第77行: 第119行:
* $tableoptions (use $wpdb->options)
* $tableoptions (use $wpdb->options)
* $tablepostmeta (use $wpdb->postmeta)
* $tablepostmeta (use $wpdb->postmeta)
* dropdown_cats
* get_archives (请使用[[WordPress:Template_Tags/wp_get_archives|wp_get_archives]])
* get_author_link (use get_author_posts_url)
* get_autotoggle
* get_linkobjects (use get_linkz)
* get_linkobjectsbyname (use get_linkz)
* get_linkswithrating
* get_linksbyname
* get_linksbyname_withrating
* get_postdata (use get_post)
* get_settings (use get_option as direct replacement)
* link_pages
* list_authors
* list_cats (请使用[[WordPress:Template_Tags/wp_list_categories|wp_list_categories]])
* next_post (请使用[[WordPress:Template_Tags/next_post_link|next_post_link]])
* previous_post (请使用[[WordPress:Template_Tags/previous_post_link|previous_post_link]])
* start_wp
* the_category_ID
* the_category_head
* tinymce_include (use wp_print_scripts or WP_Scripts)
* user_can_create_draft (use current_user_can)
* user_can_create_post (use current_user_can)
* user_can_delete_post (use current_user_can)
* user_can_delete_post_comments (use current_user_can)
* user_can_edit_post (use current_user_can)
* user_can_edit_post_comments (use current_user_can)
* user_can_edit_post_date (use current_user_can)
* user_can_edit_user (use current_user_can)
* user_can_set_post_date (use current_user_can)
* wp_get_linksbyname
* wp_get_post_cats
* wp_list_cats (请使用[[WordPress:Template_Tags/wp_list_categories|wp_list_categories]])
* wp_set_post_cats
下面的这些全局变数也已经取消:
* $tableposts  (use $wpdb->posts)
* $tableusers  (use $wpdb->users)
* $tablecategories (use $wpdb->categories)
* $tablepost2cat (use $wpdb->post2cat)(Gone in ver 2.3 $wpdb->terms)
* $tablecomments (use $wpdb->comments)
* $tablelinks (use $wpdb->links)
* $tablelinkcategories (does not exist - all categories are in the main categories table now, and there is not a separate link categories table)
* $tableoptions (use $wpdb->options)
* $tablepostmeta (use $wpdb->postmeta)


==Further Reading==
==Further Reading==
==深入阅读==


Here is a list of internal and external articles that may be of use in upgrading Themes or Plugins to Version 2.1 of WordPress:
Here is a list of internal and external articles that may be of use in upgrading Themes or Plugins to Version 2.1 of WordPress:
下面是一些外部和内部文章,可能有利于将主题和插件升级到WordPress2.1版本:
* [http://wordpress.org/development/2007/01/ella-21/ WordPress Development Blog article on the release of Version 2.1]
* [http://wordpress.org/development/2007/01/ella-21/ WordPress Development Blog article on the release of Version 2.1]
* [[WordPress:Version 2.1|WordPress Codex article on Version 2.1]]
* [[WordPress:Version 2.1|WordPress Codex article on Version 2.1]]
第89行: 第191行:
* [http://lorelle.wordpress.com/2006/08/02/when-the-blog-breaks-fixing-your-broken-blog/ Lorelle's article on fixing a broken blog]
* [http://lorelle.wordpress.com/2006/08/02/when-the-blog-breaks-fixing-your-broken-blog/ Lorelle's article on fixing a broken blog]
* [http://markjaquith.wordpress.com/2007/01/28/authorization-and-intentionorigination-verification-when-using-the-edit_post-hook/ Mark Jaquith's article on Authorization and intention/origination verification when using the edit_post hook] - affects editing plugins that do special things with tags or other Custom Fields
* [http://markjaquith.wordpress.com/2007/01/28/authorization-and-intentionorigination-verification-when-using-the-edit_post-hook/ Mark Jaquith's article on Authorization and intention/origination verification when using the edit_post hook] - affects editing plugins that do special things with tags or other Custom Fields
* [http://wordpress.org/development/2007/01/ella-21/ WordPress 开发博客关于2.1版本的文章]
* [[WordPress:Version 2.1|WordPress Codex关于2.1版本的文章]]
* [http://wordpress.org/development/2006/12/naughty-or-nice/ WordPress博客文章"你的插件好用还是不好用"]
* [[WordPress:Template Tags|模板标签]] – 主题中可以使用的模板标签列表,包括WordPress已取消的和新的标签的信息
* [http://lorelle.wordpress.com/2007/01/26/wordpress-21-template-tag-and-function-changes/ Lorelle关于将模板标签升级到2.1版本的文章]
* [http://lorelle.wordpress.com/2007/01/25/fear-not-wordpress-21-and-wordpress-plugins/ Lorelle关于升级到2.1版本的文章]
* [http://lorelle.wordpress.com/2006/08/02/when-the-blog-breaks-fixing-your-broken-blog/ Lorelle关于修正毁坏的博客的文章]
* [http://markjaquith.wordpress.com/2007/01/28/authorization-and-intentionorigination-verification-when-using-the-edit_post-hook/ Mark Jaquith关于使用edit_post hook时,授权和目的/组织的文章] – 影响处理标签或者自定义内容的编辑插件

2008年9月18日 (四) 15:07的版本

Introduction

介绍

When a new major version of WordPress is released, such as WordPress 2.1 or 2.2, you may find that your Themes and Plugins no longer work the way you are used to. It could be that they are completely broken, because something in WordPress that was fundamental to them changed, but it's also possible that you can get them working again by updating some settings, or maybe just a small edit.

发行一个新的主要版本的WordPress,如WordPress2.1或者2.2,你可能发现你的主题和插件不再向以前那样运行。可能因为插件和主题完全毁坏了,因为WordPress中对它们而言至关重要的部分更改了,但是通过上传一些设置,或者只是简单地编辑一下,你可能有能够使得这些插件和主题正常运行。

This article is part of a series on WordPress:Migrating Plugins and Themes. It covers changes between WordPress Version 2.0 and Version 2.1, and what you need to do to Plugins and Themes to get them working in Version 2.1.

这篇文章是转移插件和主题的一部分。包括WordPress2.0版本和2.1版本之间的变化,你需要做的就是,使得插件和主题能够在2.1版本中运行。

If the Theme or Plugin you are using was developed by someone else, there are several places to look for information:

如果你使用的主题或者插件是其他人开发的,你可以从下面的这些地点查找信息:

  • Your Plugin or Theme's home page
  • 你的插件或者主题的主页


If you are the author of your Theme or Plugin, or if you have modified or customized your Theme, then this article will help you upgrade your Theme/Plugin for 2.1. If your Theme or Plugin is distributed publicly, after getting it working you may want to add it to the Compatibility lists above, so your users will know it is working and which version they should be running.

如果你是主题或者插件的作者,或者如果你更改或者自定义了主题,那么这篇文章会帮助你将主题/插件升级到2.1。如果你的主题或者插件是公开发行的版本,使得插件和主题运行之后,你希望将插件或者主题添加到上述的兼容性列表,这样你的用户会了解这些插件或者主题在运行以及应该在哪个版本上运行。

Fixing Up Your Theme or Plugin

修理你的主题或者插件

The starting point for upgrading your Theme or Plugin is to understand the changes to WordPress in Version 2.1. There is an overview of the changes in the WordPress Development Blog article on the release of Version 2.1. If your plugin or theme was relying on a feature that has changed, you may need to re-think it completely.

要升级你的主题或者插件,首先要了解2.1版本中WordPress发生的变化。在WordPress 开发博客上关于2.1版本的文章上有2.1版本的变化概述。如果你的插件或者主题依赖与已经发生了变化的功能,你可能需要完全地重新考虑是否使用这样的插件或主题。

Core WordPress Database Changes

WordPress 核心数据库变化

One fairly significant change in WordPress Version 2.1 is the WordPress database structure. The main change is that in version 2.1, the categories for links (i.e. blogroll) and posts have been combined into one table. So, if your plugin does something special with the link or post category tables, you may need to modify it.

WordPress2.1版本中一个相当重要的变化是WordPress数据库结构发生变化。主要的变化是在2.1版本中,链接的类别(如友情链接)和文章的类别结合到一个表格中。因此,如果你的插件处理有关链接或者文章类别表格方面的内容,你可能就要修改插件。

Also, when a user upgrades from a previous version, the upgrade script will take their blogroll categories and merge them into the post category table. Since you cannot now have a post category and a blogroll category with the same ID numbers, the result is that the blogroll category ID numbers will all change during the update. So, if you have a Theme or Plugin that does something special with a particular blogroll category, by knowing its ID number, you will need to change the ID number(s) cited in the Theme or Plugin to the new ID numbers. To see what the current numbers are, go to the Categories section of the Manage panel in WordPress, and they will be listed in the table there.

同时,用户从先前的版本升级的时候,升级脚本会将友情链接类别合并到文章类别表格。因为你现在不能够使得文章类别和友情链接类别的ID数字相同,更新的时候,友情链接类别ID数字会在更新过程中完全更改。因此,如果你有个插件或者主题通过了解友情链接类别的ID处理友情链接类别,你需要将主题或者插件中引用的ID数字更改为新的ID数字。想看看当前的数字是多少,只要进入WordPress管理面板中的类别部分,这些数字都列在那里的表格中。

Another database change is that the WordPress "posts" table now has a new field called "post_type", which you can use in your Plugin to distinguish better between Posts and Pages. This will not cause any compatibility problems, but you might want to use it in your Plugin to improve its logic.

数据库发生的另一个变化是WordPress "文章"表格中现在有个新的栏,称为"post_type",你可以在你的插件中使用这个栏,更好的区别文章和页面。这样做不会导致任何兼容性问题,但是你可能希望在插件中使用这一栏,提高插件的逻辑。

Core WordPress File Changes

WordPress 核心文件变化

Many of the core WordPress files were either reorganized or had their names changed between Version 2.0.x and 2.1. For most Themes and Plugins, this is not a problem, but some Plugins that need access to a particular WordPress function may be loading a specific PHP file name, in order to make sure that that function is defined. If the function you are using is located in a new file now, you'll need to change the reference.

从2.0.x升级到2.1版本,许多WordPress核心文件进行了重组或者更改了名称。对于大多数主题和插件而言,这不是个问题,但是一些需要访问WordPress特别函数可能需要载入特别的PHP文件名称,以确定函数已经定义。如果你使用的函数现在位于新的文件了,你就需要更改reference。

Deprecated Functions and Variables

已取消的函数和变数

Some Plugins and Themes may be using functions and global variables that are "deprecated", which means that they were present in previous versions of WordPress, but are being phased out. They could be deleted in a future version of WordPress, without warning, and then your Plugin or Theme would stop working.

一些插件和主题可能使用"已取消"的函数和全局变数,意思是这些函数出现在先前的WordPress版本中,但是现在已经取消了。也可能在你得不到提醒的情况下,这些函数和全局变数在下一个版本中已经删除了,那么你的插件或者主题就会停止运行。

So, It is a good idea to check your Themes and Plugins for these functions, and make a substitution. Here is a (hopefully complete) list of deprecated functions (including ones deprecated in previous versions of WordPress). Replacement suggestions are also included (if they are missing and you know what they should be, feel free to jump in and edit!):

因此,为你的插件和主题,核查一下这些函数,很有必要,可以使用一些替代函数。下面是已取消的函数列表(希望完整)(包括那些在WordPress先前的版本中已取消的函数)。也包含了替换后的函数(如果缺少这些函数,你知道什么函数适合,可以加入编辑!)

  • dropdown_cats
  • get_archives (use wp_get_archives)
  • get_author_link (use get_author_posts_url)
  • get_autotoggle
  • get_linkobjects (use get_linkz)
  • get_linkobjectsbyname (use get_linkz)
  • get_linkswithrating
  • get_linksbyname
  • get_linksbyname_withrating
  • get_postdata (use get_post)
  • get_settings (use get_option as direct replacement)
  • link_pages
  • list_authors
  • list_cats (use wp_list_categories)
  • next_post (use next_post_link)
  • previous_post (use previous_post_link)
  • start_wp
  • the_category_ID
  • the_category_head
  • tinymce_include (use wp_print_scripts or WP_Scripts)
  • user_can_create_draft (use current_user_can)
  • user_can_create_post (use current_user_can)
  • user_can_delete_post (use current_user_can)
  • user_can_delete_post_comments (use current_user_can)
  • user_can_edit_post (use current_user_can)
  • user_can_edit_post_comments (use current_user_can)
  • user_can_edit_post_date (use current_user_can)
  • user_can_edit_user (use current_user_can)
  • user_can_set_post_date (use current_user_can)
  • wp_get_linksbyname
  • wp_get_post_cats
  • wp_list_cats (use wp_list_categories)
  • wp_set_post_cats

Also, the following global variables are deprecated:

  • $tableposts (use $wpdb->posts)
  • $tableusers (use $wpdb->users)
  • $tablecategories (use $wpdb->categories)
  • $tablepost2cat (use $wpdb->post2cat)(Gone in ver 2.3 $wpdb->terms)
  • $tablecomments (use $wpdb->comments)
  • $tablelinks (use $wpdb->links)
  • $tablelinkcategories (does not exist - all categories are in the main categories table now, and there is not a separate link categories table)
  • $tableoptions (use $wpdb->options)
  • $tablepostmeta (use $wpdb->postmeta)






  • dropdown_cats
  • get_archives (请使用wp_get_archives)
  • get_author_link (use get_author_posts_url)
  • get_autotoggle
  • get_linkobjects (use get_linkz)
  • get_linkobjectsbyname (use get_linkz)
  • get_linkswithrating
  • get_linksbyname
  • get_linksbyname_withrating
  • get_postdata (use get_post)
  • get_settings (use get_option as direct replacement)
  • link_pages
  • list_authors
  • list_cats (请使用wp_list_categories)
  • next_post (请使用next_post_link)
  • previous_post (请使用previous_post_link)
  • start_wp
  • the_category_ID
  • the_category_head
  • tinymce_include (use wp_print_scripts or WP_Scripts)
  • user_can_create_draft (use current_user_can)
  • user_can_create_post (use current_user_can)
  • user_can_delete_post (use current_user_can)
  • user_can_delete_post_comments (use current_user_can)
  • user_can_edit_post (use current_user_can)
  • user_can_edit_post_comments (use current_user_can)
  • user_can_edit_post_date (use current_user_can)
  • user_can_edit_user (use current_user_can)
  • user_can_set_post_date (use current_user_can)
  • wp_get_linksbyname
  • wp_get_post_cats
  • wp_list_cats (请使用wp_list_categories)
  • wp_set_post_cats

下面的这些全局变数也已经取消:

* $tableposts  (use $wpdb->posts)
  • $tableusers (use $wpdb->users)
  • $tablecategories (use $wpdb->categories)
  • $tablepost2cat (use $wpdb->post2cat)(Gone in ver 2.3 $wpdb->terms)
  • $tablecomments (use $wpdb->comments)
  • $tablelinks (use $wpdb->links)
  • $tablelinkcategories (does not exist - all categories are in the main categories table now, and there is not a separate link categories table)
  • $tableoptions (use $wpdb->options)
  • $tablepostmeta (use $wpdb->postmeta)


Further Reading

深入阅读

Here is a list of internal and external articles that may be of use in upgrading Themes or Plugins to Version 2.1 of WordPress:

下面是一些外部和内部文章,可能有利于将主题和插件升级到WordPress2.1版本: