ぐる式 (貳) より引っ越し作業中.未完.

2007年3月8日木曜日

New tags, deprecated tags

ソフトウェアというのは生き物のようなものであって,永遠に完成しない.

  1. 利用者の要求仕様は永遠に確定しない.
  2. 開発者の設計仕様も永遠に確定しない.
  3. ソフトウェアは完成することがない.

[ 青木淳 "オブジェクト指向システム分析設計入門", SRC, 1993, 1994, ISBN4-915778-19-3, p.75., より ]

のであるからして,代謝という面からしても古いのが使われなくなって (使わないよう強制されて),新しいものに置き換わるのは自然の摂理に則っている.のではあるけれども,それでも面倒くさいものは面倒なのである (笑).

WordPress 2.1 系の登場による代謝の状況はこんな感じ.下線を引いたものは思いクソ該当しているもの.出典は Template Tags « WordPress Codex.初体験が 2.0.6 と比較的新しいバージョンなんで,この程度で済んでいるんだろう[初体験は 2.0.6 でも現行最新バージョンはもう 2.1.2 だ.]

  1. Author tags

    -> the_author_link (version 2.1),なんすか,これ?[the_author_link,ソース (wp-includes/author-template.php) を見てみたら,
    function the_author_link() {    if (get_the_author_url()) {        echo '<a href="' . get_the_author_url() . '" title="' .                 sprintf(__("Visit %s's website"), get_the_author()) .                 '" rel="external">' . get_the_author() . '</a>';    } else {        the_author();    }}
    となっているんで,ああ,なるほど,一種のシュガー・タグなのねという感じだが,判らないのが else ブロックで実行される the_author(); で,何で deprecated なのを呼ぶの? と思ったが,タグが deprecated なんじゃなくて,引数が deprecated なんですね.失礼しました.他のも見てみたら, deprecated されたタグは wp-includes/deprecated.php に移されるんですな.なるほど.]
  2. Category tags

    dropdown_cats (Deprecated in 2.1)
    -> wp_dropdown_categories (Version 2.1)
    list_cats (Deprecated in 2.1), wp_list_cats (Deprecated in 2.1)
    -> wp_list_categories (Version 2.1)
  3. General tags

    get_archives (Deprecated in 2.1)
    -> wp_get_archives
  4. Link tags

    link_pages (Deprecated in 2.1)
    -> wp_link_pages
  5. Links Manager tags

    wp_get_linksbyname (Deprecated in 2.1), get_linksbyname (Deprecated in 2.1)
    -> ?
    ?
    wp_list_bookmarks (Version 2.1)
  6. Post tags (以下の二つにはバージョンは指定されてない)

    previous_post (Deprecated)
    -> previous_post_link
    next_post (Deprecated)
    -> next_post_link

    ま,『スタイルブック』でも「非推奨だから使うな」と明記してあったし.

ざっと見,引数様態がコンマ区切りと & 接続の二種類あって,動きが同じモノは後者にまとめられた,というのが目立つ.ま,実質的に修正は二箇所で済みましたが.

0 件のコメント:

コメントを投稿