WordPress 的資料庫架構更新

WordPress 2.1 Database Changes 看到 2.1 會改變本來 backward-compatible 的資料庫的存取方式 (直接指定 table name,而不是透過 $wpdb 抓 table name),這使得用舊方法的 Plugin 與 Theme 會出問題。

對於一般使用 release tarball 安裝的人應該沒有差,需要注意的人是從 SVN 版更新的。

完整的說明可以參考 WordPress 開發 Blog 上的 Is your plugin Naughty or Nice? 這篇。

6 thoughts on “WordPress 的資料庫架構更新”

  1. 啊..

    可是我看 WP 官方那邊講「...When you're developing plugins that contain SQL statements, ensure you globalize $wpdb, and call tables using $wpdb->posts, $wpdb->post2cat, etc....」

    好像是叫人家寫 plugin 的時候,要使用 $wpdb 全域變數,然後叫 table 要用 $wpdb->posts 之類的東西..orz

Leave a Reply

Your email address will not be published. Required fields are marked *