WordPressを利用して、ブログではなくCMSとして企業サイト・企業ウェブサイト作成・商用ホームページ制作のテクニックを公開。WordPressの最新ニュースやプラグインの紹介、自作プラグインやテーマも開発中。
Custom Field Template plugin

Custom Field Template plugin

Custom Field Template plugin
Custom Field Template plugin [ English Here ]

Custom Field Template plugin (カスタムフィールドテンプレート)というプラグインはカスタムフィールドの入力を支援するプラグインだ。あらかじめカスタムフィールドのテンプレートを登録しておくことでキーをその都度入力することなく、テンプレートにある項目の値を入力していくだけでよくなる。このCustom Field Templateというプラグインは、WordPressのカスタムフィールドを多用し、決まったデータを入力し公開しているようなサイトでは便利になるはずだ。

マニュアル

Custom Field Template(カスタムフィールドテンプレート)のマニュアルサイトができました。Custom Field Template の使い方については、カスタムフィールドテンプレートマニュアルをご覧ください。(日本語のみ。英語版は準備中です。)

特徴

Custom Field Template pluginは、Joshua Sigarさんが開発したrc:custom_field_guiというプラグインをベースに改良を加えたものである。rc:custom_field_guiからの変更点は以下のとおり。

  • カスタムフィールドのテンプレートを登録し、投稿ページでテンプレートを切り替えられる。
  • カスタムフィールドのテンプレートは設定ページで登録する。iniファイルは使用しない。
  • 投稿だけでなくページでもカスタムフィールドを利用できる。
  • textareaでのtinyMCEのサポート

必須条件

WordPress 2.1 以上 (WordPress 2.2.3以降でしか確認してない。)

リリースヒストリー

  • 2019.10.06 Custom Field Template 2.4.9 リリース
    • バグフィックス: Auto Hook of the_content() 。
  • 2019.09.28 Custom Field Template 2.4.7 リリース
    • Auto Hook of the_content() オプションの more タグの前 位置の追加。
  • 2018.12.03 Custom Field Template 2.4.6 リリース
    • コードクリーニング。
  • 2018.11.20 Custom Field Template 2.4.5 リリース
    • コードクリーニング。
  • 2018.10.31 Custom Field Template 2.4.4 リリース
    • コードクリーニング。
    • バグフィックス: ページでのメディアピッカー。
    • バグフィックス: カスタム投稿タイプでのクイック編集。
  • 2018.08.08 Custom Field Template 2.4.3 リリース
    • バグフィックス: テンプレートごとのボックス配置。
  • 2018.08.06 Custom Field Template 2.4.2 リリース
    • Gutenberg 対応。
  • 2018.06.20 Custom Field Template 2.4.1 リリース
    • バグフィックス: ファイル削除にチェックを入れた場合の保存ボタン。
  • 2018.06.01 Custom Field Template 2.4 リリース
    • バグフィックス: 検索。
  • 2018.06.01 Custom Field Template 2.3.9 リリース
    • コードクリーニング。
    • バグフィックス: 検索。
  • 2016.05.16 Custom Field Template 2.3.7 リリース
    • バグフィックス: format 属性を持つ[cft] ショートコード内での画像出力。
  • 2016.04.27 Custom Field Template 2.3.6 リリース
    • コードクリーニング。
    • バグフィックス: カテゴリーID、ページテンプレートファイル名による絞り込み。
  • 2015.04.26 Custom Field Template 2.3.4 リリース
    • バグフィックス: タグ保存。
  • 2015.04.03 Custom Field Template 2.3.3 リリース
    • バグフィックス: tinyMCE エディタ。
  • 2015.03.31 Custom Field Template 2.3.2 リリース
    • Auto Hook の抜粋適用オプションの追加。
    • バグフィックス: ビジュアルエディタからの画像挿入の相対パス。
  • 2015.02.23 Custom Field Template 2.3 リリース
    • 公開後のプレビュー対応。
    • コードクリーニング。
  • 2014.04.21 Custom Field Template 2.2.1 リリース
    • バグフィックス: fieldset タイプ。
  • 2014.04.18 Custom Field Template 2.2 リリース
    • バグフィックス: tinyMCE エディタ。
  • 2014.04.17 Custom Field Template 2.1.9 リリース
    • バグフィックス: tinyMCE エディタ。
  • 2013.10.13 Custom Field Template 2.1.8 リリース
    • バグフィックス: 複数ユーザーによる記事のプレビュー表示。
  • 2013.08.24 Custom Field Template 2.1.7 リリース
    • コードクリーニング。
  • 2013.07.11 Custom Field Template 2.1.6 リリース
    • バグフィックス: multipleButton 指定時の file タイプ。
    • バグフィックス: save_post の重複実行。
  • 2013.05.22 Custom Field Template 2.1.5 リリース
    • バグフィックス: multiple が有効な fieldset 内の値の保存。
  • 2013.05.15 Custom Field Template 2.1.4 リリース
    • バグフィックス: フィールドセット内のradioタイプ。
  • 2013.05.03 Custom Field Template 2.1.3 リリース
    • コードクリーニング。
  • 2013.05.03 Custom Field Template 2.1.2 リリース
    • 投稿プレビュー対応。
    • 入力順序での出力。
  • 2013.04.03 Custom Field Template 2.1.1 リリース
    • ペルシャ語。
    • バグフィックス: シングルクオテーションを含むキーの出力。
    • バグフィックス: フィールドセット内のメディアピッカー。
    • バグフィックス: PHP CODEの空の保存。
    • バグフィックス: cftsearch ショートコードでのフィールドラベル。
  • 2013.01.18 Custom Field Template 2.1 リリース
    • バグフィックス: カテゴリー絞込み。
  • 2013.01.08 Custom Field Template 2.0.9 リリース
    • バグフィックス: [cft] フォーマットの出力。
    • バグフィックス: マルチバイト文字のキー名。
  • 2012.12.13 Custom Field Template 2.0.8 リリース
    • コードクリーニング。
  • 2012.12.13 Custom Field Template 2.0.7 リリース
    • バグフィックス: メディア挿入(WordPress 3.5)。
  • 2012.11.14 Custom Field Template 2.0.6 リリース
    • バグフィックス: cftsearch ショートコードでの不必要な出力。
  • 2012.09.05 Custom Field Template 2.0.5 リリース
    • カスタムフィールドの入力にも[cft] ショートコードフォーマットのフォーマットが適用できるようになりました。自由度の高い入力画面を作成できます。[key] はインプットフィールドの出力、[[key]] はデフォルトのキーの出力に使用します。
    • textarea タイプに、`wrap` 属性の追加。`fieldset` タイプには未対応。
    • コードクリーニング。
  • 2012.04.19 Custom Field Template 2.0.4 リリース
    • バグフィックス:jQuery バリデーション利用下での JavaScript エラー。
  • 2012.04.17 Custom Field Template 2.0.3 リリース
    • バグフィックス:break タイプ使用時の mediaPicker 属性。
    • バグフィックス:メインエディタ消失。
  • 2012.04.10 Custom Field Template 2.0.2 リリース
    • バグフィックス:label属性でキーを置き換えた際のチェックボックスのoutput属性による出力。
    • バグフィックス:メディアボタン。
  • 2012.04.09 Custom Field Template 2.0.1 リリース
    • バグフィックス:マルチバイト文字がキーのHTMLエディターの切り替え。
  • 2012.04.09 Custom Field Template 2.0 リリース
    • テンプレートごとに独立したボックスで表示するオプションの追加。カテゴリーIDやページテンプレートファイル名の絞り込みは機能しません。
    • スウェーデン語。
    • バグフィックス: tinyMCEエディターの保存ボタン。
    • バグフィックス: カスタムフィールドの値出力。
  • 2012.02.03 Custom Field Template 1.9.9 リリース
    • バグフィックス:メディアボタンを使用した画像の挿入。
  • 2011.12.15 Custom Field Template 1.9.8 リリース
    • カスタム投稿タイプ下での`editor`がない場合のtinyMCEとquicktags。
    • jQuery DatePicker プラグインのアップグレード。
    • 広告右カラム。
    • ウクライナ語。
  • 2011.11.21 Custom Field Template 1.9.6 リリース
    • バグフィックス: 環境によって発生するエラー。
  • 2011.11.17 Custom Field Template 1.9.5 リリース
    • WordPress 3.3 での tinyMCE と Quicktags の対応。
    • jQuery validationプラグインのアップグレード。
    • バグフィックス: multiple と fieldset オプション。
  • 2011.08.07 Custom Field Template 1.9.4 リリース
    • カテゴリーIDでのカスタム分類対応。
  • 2011.07.24 Custom Field Template 1.9.3 リリース
    • バグフィックス: `level` 属性。
    • バグフィックス: IEでの画像挿入。
  • 2011.05.25 Custom Field Template 1.9.2 リリース
    • バグフィックス: JavaScript のファイル名のタイポ
  • 2011.05.20 Custom Field Template 1.9.1 リリース
    • バグフィックス: mediaPicker (まだmultipleButton を使用するとおかしくなる)
  • 2011.05.16 Custom Field Template 1.9 リリース
    • バグフィックス: valueLabel と valueLabels の表記ゆれ
  • 2011.05.16 Custom Field Template 1.8.9 リリース
    • バグフィックス: multiple フィールドの保存
  • 2011.05.15 Custom Field Template 1.8.8 リリース
    • ポーランド語。
    • バグフィックス: multiple フィールドの保存
    • バグフィックス: valueLabel と valueLabels の表記ゆれ
  • 2011.05.09 Custom Field Template 1.8.7 リリース
    • radio & textarea 用 before & after 属性の追加。
    • バグフィックス: file タイプの画像以外の表示
  • 2011.04.16 Custom Field Template 1.8.6 リリース
    • mediaRemove 属性の追加。mediaPicker で追加されたファイルを直接削除するのを防ぐ。例)mediaRemove = true
  • 2011.04.14 Custom Field Template 1.8.5 リリース
    • バグフィックス:テンプレート読込
  • 2011.04.13 Custom Field Template 1.8.4 リリース
    • jQuery バリデーション。グローバル設定でjQuery バリデーションを使用するにチェックを入れる必要があります。あとはクラスを追加するだけ。例) class = required, class = email, class = url など
    • textareaタイプのmultiple オプション対応。tinyMCEもOK。
    • コード整備
    • チェコ語
  • 2011.02.19 Custom Field Template 1.8.3 リリース
    • バグフィックス:fieldset タイプと通常タイプの組み合わせ
  • 2011.02.12 Custom Field Template 1.8.2 リリース
    • バグフィックス:fieldset タイプのmultiple オプション
  • 2011.01.14 Custom Field Template 1.8.1 リリース
    • バグフィックス:タグの保存
  • 2011.01.14 Custom Field Template 1.8 リリース
    • tagName 属性の追加
    • バグフィックス:検索、バリューカウント
  • 2010.11.17 Custom Field Template 1.7.9 リリース
    • バグフィックス:カスタム投稿タイプでメディア挿入時に真っ白になる不具合
  • 2010.10.25 Custom Field Template 1.7.8 リリース
    • jquery.datePicker.js の更新
  • 2010.10.25 Custom Field Template 1.7.7 リリース
    • fileタイプの画像を簡単に出力する方法。[cft key=”file” image_size=”thumbnail”] [cft key=”file” image_size=”medium” image_src=1] [cft key=”file” image_size=”large” image_width=1] [cft key=”file” image_size=”full” image_height=1]
  • 2010.10.02 Custom Field Template 1.7.6 リリース
    • バグフィックス:ボックスタイトル
    • バグフィックス:posts_per_page
  • 2010.08.15 Custom Field Template 1.7.5 リリース
    • バグフィックス:検索
  • 2010.08.11 Custom Field Template 1.7.4 リリース
    • メディアライブラリからファイルを選択できる mediaPicker 属性を file タイプに追加。multipleButton と一緒にはうまく動作しないかもしれません。(mediaPicker = true)
    • バグフィックス:eval システム
    • バグフィックス:カスタム投稿タイプでのTinyMCE
  • 2010.08.01 Custom Field Template 1.7.3 リリース
    • バグフィックス:画像挿入
  • 2010.07.31 Custom Field Template 1.7.2 リリース
    • mediaLibrary 属性の追加。file タイプでアップロードしたファイル名にギャラリーのリンクを張る。
    • バグフィックス:検索
  • 2010.06.12 Custom Field Template 1.7.1 リリース
    • バグフィックス:JavaScriptエラー
  • 2010.06.12 Custom Field Template 1.6.9 リリース
    • バグフィックス:テンプレートのローディング
  • 2010.06.04 Custom Field Template 1.6.8 リリース
    • バグフィックス:検索SQLのprepared statement化
  • 2010.06.04 Custom Field Template 1.6.7 リリース
    • バグフィックス:コードエラー。1.6.6は使用しないでください。
  • 2010.06.04 Custom Field Template 1.6.6 リリース
    • カスタム投稿タイプのクイック編集
    • バグフィックス:検索SQLのprepared statement化
    • カタルーニャ語
  • 2010.05.15 Custom Field Template 1.6.5 リリース
    • バグフィックス:投稿タイプの判定
  • 2010.05.15 Custom Field Template 1.6.4 リリース
    • デフォルトCSSの変更
    • textarea リサイザーの追加
  • 2010.04.17 Custom Field Template 1.6.3 リリース
    • バグフィックス:無効ボタン
  • 2010.04.16 Custom Field Template 1.6.2 リリース
    • グローバル設定
    • cftショートコードで呼び出されるリストと値の前と後に表示するテキスト
    • バグフィックス:WordPress 3.0での条件制御
  • 2010.04.01 Custom Field Template 1.6.1 リリース
    • バグフィックス:カスタム投稿タイプでのテンプレート選択
    • バグフィックス:カスタム投稿タイプでのデフォルトのカスタムフィールドの無効化
    • 中国語
  • 2010.03.09 Custom Field Template 1.6 リリース
    • カスタムポストタイプサポート
    • バグフィックス:値の保存、ADMIN CSS、cftsearch
    • インドネシア語、ポルトガル語
  • 2010.02.07 Custom Field Template 1.5.7 リリース
    • バグフィックス:strip slashes、Autho Hook of `the_content()`
  • 2010.01.25 Custom Field Template 1.5.6 リリース
    • バグフィックス:ページ編集画面でデフォルトのカスタムフィールドを禁止、WordPress 2.8以前のバージョンとの互換性
  • 2010.01.13 Custom Field Template 1.5.5 リリース
    • バグフィックス:画像アップロードの重複を避けるために、プレビューボタンを隠す
  • 2010.01.06 Custom Field Template 1.5.4 リリース
    • バグフィックス:id整備、検索関連
  • 2009.12.11 Custom Field Template 1.5.3 リリース(svnでしくじって1.5.2がうまくいかなかった模様)
    • バグフィックス:content中のバックスラッシュとcftsearchのORからANDへ
  • 2009.12.04 Custom Field Template 1.5.1 リリース
    • バグフィックス:バックスラッシュが保存されない
  • 2009.12.03 Custom Field Template 1.5 リリース
    • バグフィックス:fieldsetタイプ
    • バグフィックス:保存ボタン
  • 2009.11.19 Custom Field Template 1.4.9 リリース
    • テンプレート、初期化ボタン、保存ボタンを無効にするオプション追加
    • バグフィックス:enctypeがうまくセットされない
    • ファイルが削除されてもmeta valuesが消えない
  • 2009.10.29 Custom Field Template 1.4.8 リリース
    • バグフィックス:fileタイプ
  • 2009.10.29 Custom Field Template 1.4.7 リリース
    • バグフィックス:save_postアクションの重複
    • バグフィックス:fileタイプ
  • 2009.10.28 Custom Field Template 1.4.6 リリース
    • バグフィックス:チェックボックスのIDと保存
  • 2009.10.26 Custom Field Template 1.4.5 リリース
    • バグフィックス:cformsプラグインとの干渉
    • バグフィックス:値が空の時、データを削除
    • バグフィックス:チェックボックスのラベル最初のみに表示
  • 2009.10.19 Custom Field Template 1.4.4 リリース
    • バグフィックス:fileタイプ
  • 2009.10.19 Custom Field Template 1.4.3 リリース
    • バグフィックス:グループの追加ボタン、複数値の保存、クオテーションマーク
  • 2009.10.15 Custom Field Template 1.4.2 リリース
    • バグフィックス:検索まわり
  • 2009.10.15 Custom Field Template 1.4 リリース
    • ファイルアップロード機能の追加。(`type = file`)
    • アップロードするファイルを投稿と関連付ける場合は、(`relation = true`)
    • アップロードしたファイルのIDがメタ値として保存
    • 複製オプションも利用可能(`multiple = true`, `multipleButton = true`)
    • フィールドのグループ機能の追加。`type = fieldset_open` と `type = fieldset_close`でグループに含めたいフィールドを囲む。
    • `fieldset_open`と`fieldset_close`のキーは統一する必要
    • `multipleButton = true`を`fieldset_open`に指定可能。
    • グループ内でのフィールドごとの`multiple = true`と`multipleButton = true`はうまく機能しない。
    • グループ内でのtinyMCEは未対応
    • ハンガリー語、ウズベキスタン語
    • バグフィックス色々。テンプレートの解釈するコードの書き換えを行ったためバグがあるかも。
  • 2009.08.31 Custom Field Template 1.3.8 リリース
    • readOnly属性。(`readOnly = true`)
    • Date Picker用`startDate` and `endDate`属性。(`startDate = ‘1970/01/01’` and `endDate = (new Date()).asString()`)
    • `mediaOffImage`, `mediaOffVideo`, `mediaOffAudio`, and `mediaOffMedia`属性(`mediaOffImage = true`)
  • 2009.07.28 Custom Field Template 1.3.7 リリース
    • バグフィックス(class属性)
    • ショートコードをカスタムフィールドでも使用できる属性(`shortCode = true`)
    • 値がなかった場合の代替表示属性(`outputNone = No Data`)
    • 値が一つでも`<ul><li>で表示(`singleList = true`)
    • 編集リストページのカスタムフィールドを表示させないオプション
  • 2009.07.23 Custom Field Template 1.3.6 リリース
    • Changelog
    • バグフィックス(checkboxのclass属性)
  • 2009.07.05 Custom Field Template 1.3.5 リリース
    • バグフィックス(the_excerptまわり)
  • 2009.07.02 Custom Field Template 1.3.4 リリース
    • バグフィックス(スタイルシート)
  • 2009.06.30 Custom Field Template 1.3.3 リリース
    • バグフィックス(抜粋のショートコード使用オプション)
  • 2009.06.19 Custom Field Template 1.3.2 リリース
    • バグフィックス(tinyMCE)
  • 2009.06.18 Custom Field Template 1.3.1 リリース
    • バグフィックス(テンプレートファイル読み込み、the_excerptまわり)
  • 2009.06.10 Custom Field Template 1.3.0 リリース
    • テンプレートファイルによる指定
    • textタイプにDate Picker搭載。(`date = true`, `dateFirstDayOfWeek = 0`, `dateFormat = yyyy/mm/dd`)
    • バグフィックス(検索まわり、post type)
  • 2009.05.29 Custom Field Template 1.2.7 リリース
    • テンプレートを使用するPost IDの指定
    • バグフィックス(検索まわり、タグまわり)
  • 2009.05.25 Custom Field Template 1.2.6 リリース
    • バグフィックス(ビジュアルエディタ不使用時の画像挿入)
  • 2009.05.17 Custom Field Template 1.2.5 リリース
    • フランス語、ベラルーシ語
  • 2009.05.11 Custom Field Template 1.2.4 リリース
    • バグフィックス(tinyMCEの不具合)
  • 2009.04.30 Custom Field Template 1.2.3 リリース
    • バグフィックス(the_contentの不具合)
  • 2009.04.22 Custom Field Template 1.2 リリース
    • フィールド数を定めずに追加していける属性の追加。(`multiple = true`, `startNum = 5`, `endNum = 10`, `multipleButton = true`)
    • バグフィックス(検索まわり)
  • 2009.04.12 Custom Field Template 1.1.7 リリース
    • maxlength属性の追加。(maxlength = 10)
  • 2009.04.07 Custom Field Template 1.1.6 リリース
    • オートフックをフィードにも適用
  • 2009.04.06 Custom Field Template 1.1.5 リリース
    • style属性の追加
    • バグフィックス(出力まわり)
  • 2009.04.06 Custom Field Template 1.1.4 リリース
    • バグフィックス(保存まわり)
  • 2009.03.31 Custom Field Template 1.1.3 リリース
    • オプションのエクスポート、インポート
    • before、after属性の追加
    • バグフィックス(タグまわり)
  • 2009.03.26 Custom Field Template 1.1.2 リリース
    • バグフィックス(保存まわり)
  • 2009.03.22 Custom Field Template 1.1.1 リリース
    • 初期化ボタンの追加
    • 投稿コンテンツ中へのオートフックコンテンツの中 ([cfthook hook=0])
    • バグフィックス(カテゴリーまわり)
  • 2009.03.12 Custom Field Template 1.1 リリース
    • JavaScriptイベントハンドラ属性の追加。ex) onclick = alert(‘ok’); 対応イベントハンドラ: onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmouseup, onmouseover, onmouseout, onmousemove, onfocus, onblur, onchange, onselect
    • バグフィックス(カテゴリ関連付け)
  • 2009.03.08 Custom Field Template 1.0.8 リリース
    • ショートコードをウィジェットで使用するオプションの追加。
  • 2009.03.05 Custom Field Template 1.0.7 リリース
    • 投稿タイプの追加。
    • バリューカウントの追加
  • 2009.02.26 Custom Field Template 1.0.6 リリース
    • バグフィックス(JavaScript関連)
  • 2009.02.14 Custom Field Template 1.0.5 リリース
    • ボックスタイトルをテンプレートタイトルで置き換えるオプションの追加。
    • バグフィックス(自動保存まわり)
  • 2009.02.06 Custom Field Template 1.0.4 リリース
    • クイック編集を使用しないオプションの追加
    • textareaにHTML Editorの追加。 ex) htmlEditor = true
    • イタリア語対応
  • 2009.02.02 Custom Field Template 1.0.3 リリース
    • デフォルトのカスタムフィールドを停止させるオプションの追加
    • バグフィックス
  • 2009.01.28 Custom Field Template 1.0.2 リリース
    • バグフィックス
  • 2009.01.27 Custom Field Template 1.0.1 リリース
    • バグフィックス
  • 2009.01.27 Custom Field Template 1.0 リリース
    • 検索機能の追加。まだ開発中。ex) [cftsearch format=0]
    • 表示時に処理を加えるoutputCodeと保存時に処理を加えるeditCodeの追加。ex) outputCode = 1 , editCode = 2
    • 保存機能の追加。テンプレートやカテゴリー切替時の自動保存機能追加。
    • classの追加。ex) class = text
    • the_content()の自動フック機能追加。カテゴリーごとの自動表示を可能にする。
    • トルコ語、ドイツ語対応
    • バグフィックス
  • 2009.01.16 Custom Field Template 0.9.2 リリース
    • バグフィックス
  • 2009.01.15 Custom Field Template 0.9.1 リリース
    • バグフィックス
  • 2009.01.15 Custom Field Template 0.9 リリース
    • 並び替えオプションの追加。ex) sort = asc または sort = desc
    • クイック編集のサポート(tinyMCEとmediaButtonは未対応)
    • バグフィックス
  • 2009.01.09 Custom Field Template 0.8 リリース
    • valueLabelを追加。radio, checkbox, selectにおいて、実際にセットするvalueとは異なる値を表示する場合 ex) valueLabel = りんご
    • 値が空白でもカスタムフィールドの値を保存するblankオプションの追加。ex) blank = true
    • breakタイプの追加。カスタムフィールドテンプレートをdivで括る。スタイルシートでCSSを設定 ex) #cft div { width:50%; float:left; }
    • [cft] Shortcodeフォーマットの追加。
    • ロシア語対応
    • バグフィックス
  • 2008.12.22 Custom Field Template 0.7.4 リリース
    • バグフィックス
  • 2008.12.20 Custom Field Template 0.7.3 リリース
    • スペイン語対応。
    • バグフィックス
  • 2008.12.13 Custom Field Template 0.7.2 リリース
    • オリジナルのPHPコードに`checkbox`を追加。
    • バグフィックス
  • 2008.12.12 Custom Field Template 0.7.1 リリース
    • テンプレートインストラクションの追加
    • バグフィックス
  • 2008.12.09 Custom Field Template 0.7 リリース
    • カスタムフィールドの値を自動でタグに入力する ex) insertTag = true
    • カスタムフィールドの値を投稿に表示するShortcode、[cft]の追加。 output = true が設定されば項目のみ表示。
  • 2008.12.06 Custom Field Template 0.6.5 リリース
    • ユーザーレベル属性の追加。ユーザーレベルに応じてカスタムフィールドを表示する。 ex) level = 2
  • 2008.12.06 Custom Field Template 0.6.4 リリース
    • `radio`と`select`で、オリジナルのPHPコードを実行して$valuesをセットするオプション(実験的) ex) code = 0
  • 2008.11.23 Custom Field Template 0.6.3 リリース
    • バグフィックス
  • 2008.11.20 Custom Field Template 0.6.2 リリース
    • バグフィックス
  • 2008.11.18 Custom Field Template 0.6.1 リリース
    • wpautop関数使用のオプション追加
  • 2008.11.17 Custom Field Template 0.6 リリース
    • typeにtextを追加。textとtextfieldは同じ。
    • カスタムフィールドのキーをラベルで置き換えできるオプションの追加。
    • バグフィックス
  • 2008.11.13 Custom Field Template 0.5.3 リリース
    • バグフィックス
  • 2008.11.05 Custom Field Template 0.5.2 リリース
    • バグフィックス
  • 2008.11.05 Custom Field Template 0.5.1 リリース
    • labelを追加
    • スタイルシートの採用
    • テンプレートが一つの時、セレクトボックスを表示しない
  • 2008.11.05 Custom Field Template 0.5.0 リリース
    • 設定ページにオプションリストを追加
    • radioにclearButtonを追加
    • textareaのサイズ保持
    • WordPress 2.7の対応
  • 2008.10.24 Custom Field Template 0.4.4 リリース
    • 複数checkboxの指定方法の追加
  • 2008.10.23 Custom Field Template 0.4.3 リリース
    • バグフィックス
  • 2008.10.22 Custom Field Template 0.4.2 リリース
    • バグフィックス
  • 2008.10.15 Custom Field Template 0.4.1 リリース
    • バグフィックス
  • 2008.10.15 Custom Field Template 0.4 リリース
    • 同一名のキーを持つフィールドを作成可
    • hideKeyオプションの追加。hideKey = true
    • メディアボタンはデフォルトではfalse。有効にする場合は、mediaButton = tureを追加。
  • 2008.10.08 Custom Field Template 0.3.2 リリース
    • バグフィックス
  • 2008.10.05 Custom Field Template 0.3.1 リリース
    • メディアボタンのサポート
  • 2008.09.05 Custom Field Template 0.2 リリース
    • tinyMCEのサポート
  • 2008.08.31 Custom Field Template 0.1.1 リリース
    • バグフィックス
  • 2008.08.30 Custom Field Template 0.1 リリース
    • 初公開

ダウンロード

Custom Field Templateプラグインのダウンロードは下記のリンクをクリック

または

インストール

  1. Custom Field Templateをダウンロードし、圧縮ファイルを解凍後、custom-field-templateディレクトリをwp-content/pluginsディレクトリにアップロードする。
  2. WordPressのプラグインページでCustom Field Templateを有効化する。
  3. 管理メニューの設定にある、カスタムフィールドテンプレートにて、テンプレートを登録する。

寄付

プラグインがお気に召しましたら、よろしければ下記のPaypalリンクよりご寄付ください。よろしくお願いいたします。




使用方法

ここではテンプレートの設定方法を記す。基本的にrc:custom_field_guiのものと同じ。まずはサンプルを見てもらおう。

[Plan]
type = text
size = 35
label = Where are you going to go?

[Plan]
type = textfield
size = 35
hideKey = true

[Favorite Fruits]
type = checkbox
value = apple # orange # banana # grape
default = orange # grape

[Miles Walked]
type = radio
value = 0-9 # 10-19 # 20+
default = 10-19
clearButton = true

[Temper Level]
type = select
value = High # Medium # Low
default = Low

[Hidden Thought]
type = textarea
rows = 4
cols = 40
tinyMCE = true
mediaButton = true

まず、一つのセクションが一つのカスタムフィールドを指している。[]で囲まれているのがカスタムフィールドのキーである。typeには、textfield、checkbox、radio、select、textareaが指定できる。その他、size、value、default、rows、colsが適宜適用できるようになっている。とりあえず、色々試してみてほしい。

カスタムフィールドの入力は、投稿・ページの作成・編集時にテンプレートが表示されているはずなのでそこから行う。テンプレートはセレクトボックスで切り替えられるようになっている。

カスタムフィールドテンプレートのデザイン

デザインをCSSで変更できる(0.5.1より)。以下はデフォルトの設定。

#cft dl { clear:both; margin:0; padding:0; width:100%; }
#cft dt { float:left; font-weight:bold; margin:0; text-align:center; width:20%; }
#cft dt .hideKey { visibility:hidden; }
#cft dd { float:left; margin:0; text-align:left; width:80%; }
#cft dd p.label { font-weight:bold; margin:0; }

カスタムフィールドテンプレートを投稿に表示するショートコード

[cft]を投稿欄に入力するとカスタムフィールドの値をまとめて表示する(0.7より)。output = true を指定した項目のみ表示。設定できるオプションは以下のとおり。

post_id
カスタムフィールドが関連付けられているpost_idを指定する。デフォルトは現在の投稿のpost_id。

template
TEMPLATE ID。カスタムフィールドテンプレートのIDを指定する。デフォルトは0。

ex) [cft post_id=10 template=1]

[cft]ショートコードフォーマットを使用する場合

FORMAT IDが指定された場合のみ、ショートコードフォーマットが使用される。それ以外は通常表示。TEMPLATE IDは無視される。

format
FORMAT ID。ショートコードフォーマットのIDを指定する。デフォルトはなし。

ex) [cft format=0]

[cft] ショートコードフォーマットの例。[]の部分が置換されて表示されます。

<table class="cft">
<tbody>
<tr>
<th>Plan</th><td colspan="3">[Plan]</td>
</tr>
<tr>
<th>Favorite Fruits</th><td>[Favorite Fruits]</td>
<th>Miles Walked</th><td>[Miles Walked]</td>
</tr>
<tr>
<th>Temper Level</th><td colspan="3">[Temper Level]</td>
</tr>
<tr>
<th>Hidden Thought</th><td colspan="3">[Hidden Thought]</td>
</tr>
</tbody>
</table>

最後に

rc:custom_field_guiは古くからあるプラグインだが、すでに更新されておらず、もうひとつ使い勝手がよくなかった(設定を変更するのに一々iniファイルを編集する必要があった、など)。このプラグインを使用することで、データベース的に情報を整理するのにWordPressを利用している方の入力を少しでも楽にできればと思う。何か不具合とか、こういう機能を追加してほしい、というのがあればぜひ連絡してほしい。

Custom Filed Template Features

Custom Field Template

The Custom Field Template plugin adds the default custom fields on the Write Post/Page. The template format is almost same as the one of the rc:custom_field_gui plugin. The difference is following:

  • You can set any number of the custom field templates and switch the templates when you write/edit the post/page.
  • This plugin does not use the ini file for the template but set it in the option page of the plugin.

Requirement

WordPress 2.1 or higher

History

  • 2019.10.06 Custom Field Template 2.4.9 Release
    • Bugfix: Auto Hook of the_content().
  • 2019.09.28 Custom Field Template 2.4.7 Release
    • Before the more tag position for Auto Hook of the_content().
  • 2018.12.03 Custom Field Template 2.4.6 Release
    • Code cleaning.
  • 2018.11.20 Custom Field Template 2.4.5 Release
    • Code cleaning.
  • 2018.10.31 Custom Field Template 2.4.4 Release
    • Code cleaning.
    • Bugfix: media picker for pages.
    • Bugfix: quick edit for custom post types.
  • 2018.08.08 Custom Field Template 2.4.3 Release
    • Bugfix: deployment of templates.
  • 2018.08.06 Custom Field Template 2.4.2 Release
    • Support for Gutenberg.
  • 2018.06.01 Custom Field Template 2.4 Release
    • Bugfix: search.
  • 2018.06.01 Custom Field Template 2.3.9 Release
    • Code cleaning.
    • Bugfix: search.
  • 2016.05.16 Custom Field Template 2.3.7 Release
    • Bugfix: image output in the cft shortcode with the format attribute.
  • 2016.04.27 Custom Field Template 2.3.6 Release
    • Code cleaning.
    • Bugfix: Category ID and Page Template file name refinement.
  • 2015.04.26 Custom Field Template 2.3.4 Release
    • Bugfix: tag save.
  • 2015.04.03 Custom Field Template 2.3.3 Release
    • Bugfix: tinyMCE editor.
  • 2015.03.31 Custom Field Template 2.3.2 Release
    • Auto hook option for the excerpt.
    • Bugfix: relative path for images from the tinymce editor.
  • 2015.02.23 Custom Field Template 2.3 Release
    • Post preview after publishing a post.
    • Code cleaning.
  • 2014.04.21 Custom Field Template 2.2.1 Release
    • Bugfix: fieldset type.
  • 2014.04.18 Custom Field Template 2.2 Release
    • Bugfix: tinyMCE editor.
  • 2014.04.17 Custom Field Template 2.1.9 Release
    • Bugfix: tinyMCE editor.
  • 2013.10.13 Custom Field Template 2.1.8 Release
    • Bugfix: preview by multiple authors.
  • 2013.08.24 Custom Field Template 2.1.7 Release
    • Code cleaning.
  • 2013.07.11 Custom Field Template 2.1.6 Release
    • Bugfix: file type with the multipleButton attribute.
    • Bugfix: save_post duplicate execution.
  • 2013.05.22 Custom Field Template 2.1.5 Release
    • Bugfix: values in a multiple fieldset.
  • 2013.05.15 Custom Field Template 2.1.4 Release
    • Bugfix: radio type in a fieldset.
  • 2013.05.03 Custom Field Template 2.1.3 Release
    • Code cleaning.
  • 2013.05.03 Custom Field Template 2.1.2 Release
    • Post preview support.
    • Sort output by the input order.
  • 2013.04.03 Custom Field Template 2.1.1 Release
    • Farsi.
    • Bugfix: key output with single quotes.
    • Bugfix: media picker inside the fieldset type.
    • Bugfix: empty save of PHP CODE.
    • Bugfix: field label in the cftsearch shortcode.
  • 2013.01.08 Custom Field Template 2.1 Release
    • Bugfix: category refinement.
  • 2013.01.08 Custom Field Template 2.0.9 Release
    • Bugfix: output with the cft format.
    • Bugfix: multibyte character key name.
  • 2012.12.13 Custom Field Template 2.0.8 Release
    • Code cleaning.
  • 2012.12.13 Custom Field Template 2.0.7 Release
    • Bugfix: media insert.
  • 2012.11.14 Custom Field Template 2.0.6 Release
    • Bugfix: inappropriate output with the cftsearch shortcode.
  • 2012.09.05 Custom Field Template 2.0.5 Release
    • Template Format for the edit screen. `[key]` will be converted to the input field. `[[key]]` is for the default key output. The `fieldset` type has not been supported yet.
    • `wrap` attribute for the textarea type.
    • Code cleaning.
  • 2012.04.19 Custom Field Template 2.0.4 Release
    • Bugfix: JavaScript error with jQuery validation.
  • 2012.04.17 Custom Field Template 2.0.3 Release
    • Bugix: mediaPicker attribute with a break type.
    • Bugix: disappearance of the main editor.
  • 2012.04.10 Custom Field Template 2.0.2 Release
    • Bugix: checkbox output with the label attribute.
    • Bugix: mediaButton attribute.
  • 2012.04.09 Custom Field Template 2.0.1 Release
    • Bugix: multibyte string key names with the html editor.
  • 2012.04.09 Custom Field Template 2.0 Release
    • Option to deploy the box in each template. Category ID and page template file name refinement have not been supported yet.
    • Swedish (sv_SE) – Pontus Carlsson
    • Bugfix: save button with the tinyMCE editor.
    • Bugfix: output of custom field values.
  • 2012.02.03 Custom Field Template 1.9.9 Release
    • Code cleaning.
    • Bugfix: image insertion using the media button.
  • 2011.12.15 Custom Field Template 1.9.8 Release
    • tinyMCE and quicktags in custom post types without `editor`.
    • Upgrade of jQuery DatePicker plugin.
    • Advertisement right column.
    • Ukranian (uk_UA) – Andrew Kovalev
  • 2011.11.21 Custom Field Template 1.9.6 Release
    • Bugfix: error occurs in some circumstances.
  • 2011.11.17 Custom Field Template 1.9.5 Release
    • tinyMCE and quicktags in WordPress 3.3.
    • Upgrade of jQuery Validation Plugin.
    • Bugfix: multiple and fieldset options (Thanks, Colin Duwe).
  • 2011.08.07 Custom Field Template 1.9.4 Release
    • Support of taxonomies in the category ID field.
  • 2011.07.24 Custom Field Template 1.9.3 Release
    • Bugfix: `level` attribute.
    • Bugfix: image insert in IE.
  • 2011.05.25 Custom Field Template 1.9.2 Release
    • Bugfix: js filename typo.
  • 2011.05.20 Custom Field Template 1.9.1 Release
    • Bugfix: `mediaPicker`, still buggy with the `multipleButton` attribute.
  • 2011.05.16 Custom Field Template 1.9 Release
    • Bugfix: inconsistency of valueLabel and valueLabels.
  • 2011.05.16 Custom Field Template 1.8.9 Release
    • Bugfix: saving multiple fields.
  • 2011.05.15 Custom Field Template 1.8.8 Release
    • Polish (pl_PL) – Difreo
    • Bugfix: saving multiple fields.
    • Bugfix: inconsistency of valueLabel and valueLabels.
  • 2011.05.09 Custom Field Template 1.8.7 Release
    • before and after attributes for the radio and textarea types.
    • Bugfix: file type.
  • 2011.04.16 Custom Field Template 1.8.6 Release
    • Adds the `mediaRemove` attribute in order to prevent from deleting the file registered from the mediaPicker. ex) mediaRemove = true
  • 2011.04.14 Custom Field Template 1.8.5 Release
    • Bugfix: template loading.
  • 2011.04.13 Custom Field Template 1.8.4 Release
    • Form validation with the jQuery validatation plugin. You need to check `Use the jQuery validation` in the global settings. ex) class = required, class = email, class = url, etc.
    • Support of the multiple option of the textarea type with TinyMCE.
    • Code cleaning.
    • Czech (cs_CZ) – Jakub
  • 2011.02.19 Custom Field Template 1.8.3 Release
    • Bugfix: combination of the fieldset type and the normal type.
  • 2011.02.12 Custom Field Template 1.8.2 Release
    • Bugfix: multiple options for the fieldset type.
  • 2011.01.14 Custom Field Template 1.8.1 Release
    • Bugfix: tag save.
  • 2011.01.14 Custom Field Template 1.8 Release
    • Added the tagName attribute for the insertTag of the custom taxonomy.
    • Bugfix: value count.
    • Bugfix: search.
  • 2010.11.17 Custom Field Template 1.7.9 Release
    • Bugfix: media blank issue of the custom post type.
  • 2010.10.25 Custom Field Template 1.7.8 Release
    • Updated jquery.datePicker.js
  • 2010.10.25 Custom Field Template 1.7.7 Release
    • Easier way to output images of the file type. ex) [cft key=”file” image_size=”thumbnail”] [cft key=”file” image_size=”medium” image_src=1] [cft key=”file” image_size=”large” image_width=1] [cft key=”file” image_size=”full” image_height=1]
    • You can use shortcodes in the cft shortcode format.
    • Bugfix: search.
    • Dutch (nl_NL) – Rene
  • 2010.10.02 Custom Field Template 1.7.6 Release
    • Bugfix: Box title.
    • Bugfix: posts_per_page.
  • 2010.08.15 Custom Field Template 1.7.5 Release
    • Bugfix: Search
  • 2010.08.10 Custom Field Template 1.7.4 Release
    • `mediaPicker` attribute for the file type to select the file form Media Library. This attribute currently does not work with `multipleButton` attribute. ex) `mediaPicker = true`
    • Bugfix: eval system.
    • Bugfix: TinyMCE for the custom post types.
  • 2010.08.01 Custom Field Template 1.7.3 Release
    • Bugfix: image insert.
  • 2010.07.31 Custom Field Template 1.7.2 Release
    • `mediaLibrary` attribute for the file type to show the link of the uploaded file name.
    • Bugfix: search.
  • 2010.06.12 Custom Field Template 1.7.1 Release
    • Bugfix: JavaScript error.
  • 2010.06.12 Custom Field Template 1.6.9 Release
    • Bugfix: template loading.
  • 2010.06.04 Custom Field Template 1.6.8 Release
    • Bugfix: prepared statement of cft search sqls.
  • 2010.06.04 Custom Field Template 1.6.7 Release
    • Bugfix: code error. Do not use 1.6.6.
  • 2010.06.04 Custom Field Template 1.6.6 Release
    • Quick Edit for the custom post type.
    • Bugfix: prepared statement of cft search sqls.
    • Catalan (ca) – Andreu Llos
  • 2010.05.15 Custom Field Template 1.6.5 Release
    • Bugfix: the judgement of post types.
  • 2010.05.15 Custom Field Template 1.6.4 Release
    • Changed the default ADMIN CSS.
    • Textarea resizer.
  • 2010.04.17 Custom Field Template 1.6.3 Release
    • Bugfix: use diable button
  • 2010.04.16 Custom Field Template 1.6.2 Release
    • Global Settings
    • Text to place before and after every list and value which is called by the cft shortcode
    • Bugfix: controlling conditions in WordPress 3.0
  • 2010.04.01 Custom Field Template 1.6.1 Release
    • Bugfix: selectable custom field templates in the custom post type.
    • Bugfix: disable the default custom fields in the custom post type.
    • Chinese (zh_CN) – hurri zhu
  • 2010.03.09 Custom Field Template 1.6 Release
    • Custom post type support.
    • Bugfix: meta value save, ADMIN CSS, and cftsearch.
    • Brazilian Portuguese (pt_BR) – Caciano Gabriel
    • Indonesian (id_ID) – Masino Sinaga
  • 2010.02.07 Custom Field Template 1.5.7 Release
    • Bugfix: strip slashes.
    • Bugfix: misjudgment of Autho Hook of `the_content()`.
  • 2010.01.25 Custom Field Template 1.5.6 Release
    • Bugfix: disable the default custom fields in the page edit screen.
    • Bugfix: compatible with old WordPress versions.
  • 2010.01.13 Custom Field Template 1.5.5 Release
    • Bugfix: hide the preview button in order to prevent duplicate uploads.
  • 2010.01.06 Custom Field Template 1.5.4 Release
    • Bugfix: custom field ids.
  • 2009.12.11 Custom Field Template 1.5.3 Release
    • Bugfix: backslashes and cftsearch.
  • 2009.12.04 Custom Field Template 1.5.1 Release
    • Bugfix: backslashes are not saved.
  • 2009.12.03 Custom Field Template 1.5 Release
    • Bugfix: fieldset type.
    • Bugfix: ajax save button.
  • 2009.11.19 Custom Field Template 1.4.9 Release
    • Options to disable the cutom field template, the initialize button, and the save button.
    • Bugfix: enctype missing.
    • Bugfix: meta values not being deleted when a file is deleted.
  • 2009.10.29 Custom Field Template 1.4.8 Release
    • Bugfix: file type.
  • 2009.10.29 Custom Field Template 1.4.7 Release
    • Bugfix: duplicate save_post action.
    • Bugfix: file type.
  • 2009.10.28 Custom Field Template 1.4.6 Release
    • Bugfix: checkbox ID and save.
  • 2009.10.26 Custom Field Template 1.4.5 Release
    • Bugfix: conflict with the cforms plugin.
    • Bugfix: delete the empty data.
    • Bugfix: checkbox label.
  • 2009.10.19 Custom Field Template 1.4.4 Release
    • Bugfix: file type.
  • 2009.10.19 Custom Field Template 1.4.3 Release
    • Bugfix: group add new button, multiple values, and quotation marks.
  • 2009.10.15 Custom Field Template 1.4.2 Release
    • Bugfix: search functionality.
  • 2009.10.15 Custom Field Template 1.4 Release
    • `file` type in order to upload images. If you set `relation = true` with `type = file`, the image you upload will be related to the post you are editing. The image id will be saved as the meta value. You can use the `multiple = true` and `multipleButton = true`.
    • The group functionality. The fields between `type = fieldset_open` and `type = fieldset_close` will be enclosed in the fieldset. The key name of the `fieldset_open` and `fieldset_close` must be same. You can use `multipleButton = true` with `type = fieldset_open`. You can also use the `legend = blah` attribute.
    • Revision of the interpretation of the template codes.
    • Bugfix: loading templates in switching catgories.
    • Hangarian and Uzbek.
  • 2009.08.31 Custom Field Template 1.3.8 Release
    • `readOnly` attribute. ex) `readOnly = true`
    • `startDate` and `endDate` attributes for the date picker. ex) `startDate = ‘1970/01/01’` and `endDate = (new Date()).asString()`
    • * `mediaOffImage`, `mediaOffVideo`, `mediaOffAudio`, and `mediaOffMedia` attributes. ex) `mediaOffImage = true`
  • 2009.07.28 Custom Field Template 1.3.7 Release
    • Bugfix: class attribute of `text` type.
    • `shortCode` attribute in order to output the shortcode filtered values. ex) `shortCode = true`
    • `outputNone` attribute in case there is no data to output. ex) `outputNone = No Data`
    • `singleList` attribute in order to output with `<ul><li>` if the value is single. ex) `singleList = true`
    • Option not to display the custom field column on the edit post list page.
  • 2009.07.23 Custom Field Template 1.3.6 Release
    • Changelog
    • Bugfix: class attribute for checkboxes
  • 2009.07.05 Custom Field Template 1.3.5 Release
    • Bugfix: the_excerpt
  • 2009.07.02 Custom Field Template 1.3.4 Release
    • Bugfix: Style Sheet
  • 2009.06.30 Custom Field Template 1.3.3 Release
    • Adds Exerpt Shortcode option
  • 2009.06.19 Custom Field Template 1.3.2 Release
    • Bugfix: tinyMCE
  • 2009.06.18 Custom Field Template 1.3.1 Release
    • Bugfix: page template loading, the_excerpt()
  • 2009.06.10 Custom Field Template 1.3.0 Release
    • Adds the attributes of the date picker in `text` type. (`date = true`, `dateFirstDayOfWeek = 0`, `dateFormat = yyyy/mm/dd`)
    • Adds the filter of page template file names (Thanks, Joel Pittet).
    • Bugfix: search, post type
  • 2009.05.29 Custom Field Template 1.2.7 Release
    • Post ID options
    • Bugfix: inserting tags and search
  • 2009.05.25 Custom Field Template 1.2.6 Release
    • Bugfix: inserting images
  • 2009.05.17 Custom Field Template 1.2.5 Release
    • French and Belorussian
  • 2009.05.11 Custom Field Template 1.2.4 Release
    • Bugfix: tinyMCE
  • 2009.04.30 Custom Field Template 1.2.3 Release
    • Bugfix: the_content
  • 2009.04.22 Custom Field Template 1.2 Release
    • Adds the attributes of multiple fields. (`multiple = true`, `startNum = 5`, `endNum = 10`, `multipleButton = true`)
    • Bugfix: search
  • 2009.04.12 Custom Field Template 1.1.7 Release
    • Adds the maxlength attribute. (`maxlength = 10`)
  • 2009.04.07 Custom Field Template 1.1.6 Release
    • Applies the auto hook to feeds.
  • 2009.04.06 Custom Field Template 1.1.5 Release
    • Adds the style attribute.
    • Bugfix: output
  • 2009.04.06 Custom Field Template 1.1.4 Release
    • Bugfix: saving the meta data
  • 2009.03.31 Custom Field Template 1.1.3 Release
    • Adds the attributes of before and after text. (`before = blah`, `after = blah`)
    • Adds the export and import functionality.
    • Bugfix: tags
  • 2009.03.26 Custom Field Template 1.1.2 Release
    • Bugfix: improve the efficiency of saving data
  • 2009.03.22 Custom Field Template 1.1.1 Release
    • Adds the Initialize button.
    • Auto hook inside the content ([cfthook hook=%d])
    • Bugfix: category
  • 2009.03.12 Custom Field Template 1.1 Release
    • Adds the attributes of JavaScript Event Handlers. (`onclick = alert(‘ok’);`) Event Handlers: onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmouseup, onmouseover, onmouseout, onmousemove, onfocus, onblur, onchange, onselect
    • Bugfix: category
  • 2009.03.08 Custom Field Template 1.0.8 Release
    • Adds the option to use the shortcode in the widhet.
  • 2009.03.05 Custom Field Template 1.0.7 Release
    • Adds the select option of the post type.
    • Adds the value count option.
  • 2009.02.26 Custom Field Template 1.0.6 Release
    • Bugfix: JavaScript
  • 2009.02.14 Custom Field Template 1.0.5 Release
    • Adds the box title replacement option.
    • Bugfix: autosave
  • 2009.02.06 Custom Field Template 1.0.4 Release
    • Adds the option to disable the quick edit.
    • Adds the attribute of HTML Editor in the textarea. (`htmlEditor = true`)
    • Italian (it_IT) – Gianni Diurno
  • 2009.02.02 Custom Field Template 1.0.3 Release
    • Adds the option to disable the default custom fields.
    • Bugfix
  • 2009.01.28 Custom Field Template 1.0.2 Release
    • Bugfix
  • 2009.01.27 Custom Field Template 1.0.1 Release
    • Bugfix
  • 2009.01.27 Custom Field Template 1.0 Release
    • Support for the custom field search. (only shows the attributes which have `search = true`.)
    • Adds [cftsearch] Shortcode Format. (under development)
    • Adds PHP codes for the output value. (`outputCode = 0`)
    • Adds PHP codes before saving the values. (`editCode = 0`)
    • Adds the save functionality.
    • Adds the class option. (`class = text`)
    • Adds the auto hook of `the_content()`. (experimental)
    • German (de_DE) – F J Kaiser
    • Turkish (tr_TR) – Omer Faruk
    • Bugfix
  • 2009.01.16 Custom Field Template 0.9.2 Release
    • Bugfix
  • 2009.01.15 Custom Field Template 0.9.1 Release
    • Bugfix
  • 2009.01.15 Custom Field Template 0.9 Release
    • Adds the sort option. (`sort = asc` or `sort = desc`)
    • Support for Quick Edit of custom fields. (tinyMCE and mediaButton are not supported yet)
    • Bugfix
  • 2009.01.09 Custom Field Template 0.8 Release
    • Adds the value label option for the case that values are diffrent from viewed values. (`valueLabel = apples # oranges # bananas`)
    • Adds the blank option. (`blank = true`)
    • Adds the break type. Set CSS of ‘#cft div’. ex) `type = break` | #cft div { width:50%; float:left; }
    • Adds [cft] Shortcode Format.
    • Russian (ru_RU) – Sonika
    • Bugfix
  • 2008.12.22 Custom Field Template 0.7.4 Release
    • Bugfix
  • 2008.12.20 Custom Field Template 0.7.3 Release
    • Spanish (es_ES) – Dario Ferrer (Thank you for the CFT logo!)
    • Bugfix
  • 2008.12.13 Custom Field Template 0.7.2 Release
    • Support PHP codes for `checkbox`.
    • Bugfix
  • 2008.12.12 Custom Field Template 0.7.1 Release
    • Adds Template Instruction
    • Bugfix
  • 2008.12.09 Custom Field Template 0.7 Release
    • Supprt for inserting custom field values into tags automatically. ex) `insertTag = true`
    • Adds [cft] Shortcode to display the custom field template. (only shows the attributes which have `output = true`)
  • 2008.12.06 Custom Field Template 0.6.5 Release
    • You can set an access user level in each field. ex) level = 2
  • 2008.12.06 Custom Field Template 0.6.4 Release
    • You can use PHP codes in order to set values of `radio` and `select` types. ex) code = 0
  • 2008.11.23 Custom Field Template 0.6.3 Release
    • Bugfix
  • 2008.11.20 Custom Field Template 0.6.2 Release
    • Bugfix
  • 2008.11.18 Custom Field Template 0.6.1 Release
    • Adds wpautop function option
  • 2008.11.17 Custom Field Template 0.6 Release
    • Adds `type = text`, which is same as `type = textfield`
    • Adds an option to replace custom keys by labels
    • Bugfix
  • 2008.11.13 Custom Field Template 0.5.3 Release
    • Bugfix
  • 2008.11.05 Custom Field Template 0.5.2 Release
    • Bugfix
  • 2008.11.05 Custom Field Template 0.5.1 Release
    • Adds `label = blah-blah-blah`.
    • Adopts CSS design for custom field templates.
    • Displays the cft select box only if it has multiple templates.
  • 2008.11.05 Custom Field Template 0.5.0 Release
    • You can see the full option list in the setting page.
    • Adds `clearButton = true` in radios.
    • Keeps tinyMCE height after resizing the textarea and saving the post.
    • Compatible with WordPress 2.7 Beta 1
  • 2008.10.24 Custom Field Template 0.4.4 Release
    • Support for the other way of multiple checkboxes. See the example.
  • 2008.10.23 Custom Field Template 0.4.3 Release
    • Bugfix
  • 2008.10.22 Custom Field Template 0.4.2 Release
    • Bugfix
  • 2008.10.15 Custom Field Template 0.4.1 Release
    • Bugfix
  • 2008.10.15 Custom Field Template 0.4 Release
    • Support for multiple fields with the same key
    • Adds hideKey options. ex. hideKey = true
    • The default of media buttons is false. ex. mediaButton = true
  • 2008.10.08 Custom Field Template 0.3.2 Release
    • Bugfix
  • 2008.10.05 Custom Field Template 0.3.1 Release
    • Support for media buttons in the textarea
  • 2008.09.05 Custom Field Template 0.2 Release
    • Support for TinyMCE in the textarea
  • 2008.08.31 Custom Field Template 0.1.1 Release
    • Bugfix
  • 2008.08.30 Custom Field Template 0.1 Release

Download

or

Install

  1. Copy the `custom-field-template` directory into your `wp-content/plugins` directory
  2. Activate the plugin through the `Plugins` menu in WordPress
  3. Edit the options in `Settings` > `Custom Field Template`
  4. That’s it! :)

Donation

If you liked this plugin, please make a donation via paypal! Any amount is welcome. Your support is much appreciated.




How to use

This is the example of the template. The template format is basically same as the one of the rc:custom_field_gui plugin.

[Plan]
type = text
size = 35
label = Where are you going to go?

[Plan]
type = textfield
size = 35
hideKey = true

[Favorite Fruits]
type = checkbox
value = apple # orange # banana # grape
default = orange # grape

[Miles Walked]
type = radio
value = 0-9 # 10-19 # 20+
default = 10-19
clearButton = true

[Temper Level]
type = select
value = High # Medium # Low
default = Low

[Hidden Thought]
type = textarea
rows = 4
cols = 40
tinyMCE = true
mediaButton = true

Each section means one custom field. The key of the custom field is between []. The types are textfield, checkbox, radio, select, and textarea. There are some other arbitrary options: size, default, value, rows, and cols. Just do by trial and error.

CSS design for custom field templates

You can change the design of custom field templates by use of CSS in the setting page. This is the default CSS.

#cft dl { clear:both; margin:0; padding:0; width:100%; }
#cft dt { float:left; font-weight:bold; margin:0; text-align:center; width:20%; }
#cft dt .hideKey { visibility:hidden; }
#cft dd { float:left; margin:0; text-align:left; width:80%; }
#cft dd p.label { font-weight:bold; margin:0; }

[cft] Shortcode for viewing the values of custom field templates

Only shows the attributes which have `output = true`.

post_id
The default is current post_id.

template
TEMPLATE ID. The default is 0.

ex) [cft post_id=10 template=1]

[cft] Shortcode Format

Shortcode Format is applied only if the format attribute is set. TEMPLATE ID is ignored.

format
FORMAT ID. The defalut is null.

ex) [cft format=0]

This is a shortcode format example.

<table class="cft">
<tbody>
<tr>
<th>Plan</td><td colspan="3">[Plan]</td>
</tr>
<tr>
<th>Favorite Fruits</th><td>[Favorite Fruits]</td>
<th>Miles Walked</th><td>[Miles Walked]</td>
</tr>
<tr>
<th>Temper Level</th><td colspan="3">[Temper Level]</td>
</tr>
<tr>
<th>Hidden Thought</th><td colspan="3">[Hidden Thought]</td>
</tr>
</tbody>
</table>

Thanks.

817 Comments

  1. 便利なプラグインありがとうございます。
    ちょっと不具合がありまして、問い合わせします。

    WP3.3.1+Custom Field Template 1.9.8です。
    投稿のみ、特定のカテゴリ下で表示されるように設定しています。

    修正を行い、記事更新を行ったところ、次に開いた時に、カスタムフィールドが表示されなくなります。対象となるカテゴリをチェックし直すと、また表示されます。
    カスタムフィールドデータは正常に入っているようです。

    ご確認お願いします。

    Minoru
  2. お世話になります。いつも便利に利用させていただいております。

    不具合が発生しまして、動作の確認をお願いしたいのですが、

    +カスタムポストタイプ
     ・type1、type2
    +カスタムタクソノミー
     ・type1_kind、type2_kind
    +ターム
     ・type1_kind
      →abc(ID=4)
     ・type2_kind
      →xyz(ID=5)

    の様な状況下で、カスタムフィールドテンプレートで、

    テンプレートタイトル:CFT_type1
     +カスタムポストタイプ
      ・type1
     +カテゴリーID
      ・4

    テンプレートタイトル:CFT_type2
     +カスタムポストタイプ
      ・type2
     +カテゴリーID
      ・5

    のような、順でテンプレートを作成した場合、投稿画面で、タームを選択しても、
    CFT_type1は読み込むのですが、CFT_type2は読み込まれません。

    CFT_type2を先にテンプレートをした場合は、CFT_type2は読み込むのですが、CFT_type1は読み込まれません。

    IDやポストタイプ名に間違いはなく、違う環境のサーバーで試したりなどしても、不具合が発生します。

    お手数おかけしますが、ご確認いただければ幸いです。

    やま
  3. メディアボタンからのmedia-upload.phpのURLに不具合があります。

    例えば、「URLから」追加の場合
    media-upload.php?post_id=100type%3Dimage&tab=type_url
    のようになり、タイトル以下のテキストフィールド・ボタンが表示されません。

    media-upload.php?post_id=100&type=image&tab=type_url
    のように”ID”と”type”の間に”&”を追加、”%3D”を”=”に変更すると表示されます。

    (「URLから」以外の追加もURLに不具合があるように思いますが、とりあえずは動作します。)

    k
  4. Pingback: WordPressに入れてるプラグイン自分用まとめ!!!

  5. Pingback: Top 100 WordPress Plugins yang Perlu Ada | Wan Rizuan Blog

  6. Pingback: カスタムフィールドをあつかうならMagic Fields | Good User / グット・ユーザー

  7. wordpress 3.3.1において「htmlEditor = true」でカスタムフィールドのキーが日本語の場合、ビジュアルモードであってもHTMLエディターが表示されます。HTMLエディターは表示されているだけでボタンは利きません。
    (HTMLモードでは通常どおりビジュアルエディターが非表示になり、HTMLエディターのみが表示されます。)

    k
  8. お世話になります。
    カスタムフィールドテンプレートプラグインをWORDPRESS バージョン3.3.1にて利用させていただいております。素晴らしいプラグイン有難うございます。

    本日プラグインを2.0.1に更新しました所、

    mediaButton = true
    を設定しているカスタムフィールドの動作がおかしくなってしまいました。

    mediaButton = trueを設定した事により出現するメディアアイコンをクリックするとメディア選択画面がポップアップでははなく新しい1画面として出現し、メディアを選択し「投稿に挿入」をクリックしても投稿されずに真っ白の画面になってしまいます。

    お手数おかけして申し訳ないですが、一度確認してもらえると幸いです。

    MATSUMOTO
  9. Pingback: WordPressでカスタムフィールドを使いやすくするプラグイン「Magic Fields 2」 : Toro_Unit

  10. Pingback: そろそろ使ってるWordpressのプラグインを見直してもいい頃 | OpenMediaLaboratory

  11. すごく便利なプラグインありがとうございます。

    現在、長い文字列(URL等)をtextareaに複数入力させたい場合自動で改行させたくないので wrap = offのパラメータが反映されるよう自分でカスタマイズして使用しております。

    何かのタイミングで textarea のオプションに wrap = off|soft|hard の設定ができるようにしてもらうことはできないでしょうか。

    furu
  12. Pingback: 定型化した入力項目に便利!「カスタムフィールド」 | ホームページ制作MAKAP

  13. Pingback: 俺流の!WordPressで動作デモのページを作るチュートリアル | ゴウテンネット -GOUTEN.NET-

  14. how to make fields to excerpt(show to frontpage)
    like….
    fields….
    -author : arie (no excerpt)
    -source : link (no excerpt)
    -overview : content overview (this 100 word of excerpt)
    -fields4 (excerpt)
    -fields5 (no excerpt)
    -post content form(no excerpt)

    only one to excerpt ,(overview fields)..
    how make this…
    thank advanced …

    sinji kagawa
  15. Hey man
    Great plugin you made here!
    Do you think it is possible to add the custom field template options/values as a form in a page or widget?
    I am using the custom fields as attributes of some pages and builded a search engine with the meta info. Now I would like to build a search form with the options I added on the plugin admin page.
    Do you think thats possible? Where can I get the info of the fields?
    Thanks!!

    Juan Ruiz
  16. Pingback: The Top 100 WordPress Plugins For Your Site @ Developeranywhere

  17. Installed the plugin on a WordPress Network site and it works on the site where I want to use it.
    But when saving changes to a page on another site I get the following messages:
    Warning: Cannot unset offset in a non-array variable in /home2/zoft/public_html/xxxxx.com/wp-content/plugins/custom-field-template/custom-field-template.php on line 2890

    Warning: Cannot unset offset in a non-array variable in /home2/zoft/public_html/xxxxx.com/wp-content/plugins/custom-field-template/custom-field-template.php on line 2890

    Warning: Cannot modify header information – headers already sent by (output started at /home2/zoft/public_html/xxxxx.com/wp-content/plugins/custom-field-template/custom-field-template.php:2890) in /home2/zoft/public_html/xxxxx.com/wp-includes/pluggable.php on line 881

    Lennart Johansson
  18. いつもお世話になっております。
    バグのご報告です
    (ver.2.0.4 on WP3.4.1)

    デバッグモードをTrueにしたところ、以下のエラーが出るようになりました
    Notice: Undefined variable: post in wp-content/plugins/custom-field-template/custom-field-template.php on line 355

    344行目を
    global $wp_version, $post;
    と変更したところエラーが出なくなりました。

    ご確認のほど、よろしくお願いいたします

    kato
  19. Pingback: 地ビール醸造所の紹介サイト「地ビールの森」をリニューアルしました!! | ジャンクワードの森

  20. こんにちは。
    素敵なプラグインありがとうございます。

    カスタムフィールドテンプレートオプションで、特定のカテゴリのみ除外させる方法はございますでしょうか?

    【カテゴリーID (カンマ区切り):】
    ここに、除外させたいカテゴリーを指定して、例えば-9(カテゴリID 9のみを除外)といった指定が可能なのか、またこの他にこれらを実現する方法がないか探しています。

    仕様の根本からお聞きするカタチで申し訳ございませんが、アドバイスいただけますと幸いです。

    ヘッドココロ
  21. お世話になります。
    カスタムフィールドテンプレートプラグイン愛用させていただいています。

    今回、新たにWORDPRESSバージョン3.4.1にてカスタムフィールドテンプレートバージョン 2.0.5利用した所下記の不具合が起こりました。
    非常に便利なプラグインなので確認してもらえると幸いです。

    前提:Type = textarea/htmlEditor = trueのケース
    1.linkボタンを押してもlink入力のポップアップがでないケースがある。
    (恐らく一度メインのエディタ(post_content)でlinkボタン使用後に使用可能となるよう)
    2.linkボタンが使用可の場合で、リンク先等を入力できた場合でも、
    タグが当該カスタムフィールドではなくメインのエディタ(post_content)入力欄に出力されてします。

    お手数ですがよろしくお願いします。

    Hiroki
  22. Pingback: Top WordPress Plugins: The 100 Best For Your Site - WPMU.org

  23. Pingback: Accepted WordPress Plugins

  24. Pingback: Every Tutorials | Tutorials about… everything

  25. Pingback: Top 100 Popular WordPress Plugins For Your Site | DMD Designs

  26. Having an issue with upgrade to wordpress 3.5, this plugin seems to break the new media uploader. Upload/gallery function are ok but inserting a new image into the post does not work. I heavily rely on this plugin so I’m hoping for quick fix!

    Lindsay
  27. Pingback: The Top 100 WordPress Plugins For Your Site

  28. Pingback: The 100 Top WordPress Plugin Untuk Situs Anda | BOXMOO

  29. Pingback: 100 WordPress pluginova za vaš sajt | Tehnologija.me

  30. Pingback: TOP 100 PLUGIN WORDPRESS TERBAIK « norynazis

  31. Pingback: Blog de Hosting WordPress El Top 100 mejores plugins para WordPress

  32. Pingback: 100個推薦的Wordpress外掛 | MD Blog

  33. Version 2.1 で検索フォームが出力されません。

    ショートコードで format を指定すると出力されますので、
    search_custom_field_values() で shortcode_atts している所の、

    3504 行目 ‘format’ => ”,
    の為だと思うのですが、

    ‘format’ => 0,

    にすると何か不都合がありますでしょうか。

    linkseed
  34. format’ => isset($options[‘custom_fields’][0][‘format’]) ? $options[‘custom_fields’][0][‘format’] : 0,

    ならどうでしょうか?

    なんども申し訳ありません。

    linkseed
  35. 自己解決しました。

    中途半端に読んで、お騒がせしました。

    お手数ですが、上記のコメントは削除してください。
    本当に申し訳ありません。

    linkseed
  36. Hi, I bought your custom field template manual but looking through the Admin CSS it doesnt show what the following means/refers to? (it only shows the . Cft dl)
    .cft dt
    .cft dd
    .cft_instruction
    .cft fieldset

    Also – the output for checkbox (multiple results), how can I change it so that results appear on one line instead of underneath each other?

    Thanks for the plugin, its really suited to my needs.

    bj
  37. いつもありがたく使わせていただいております。

    Version 2.1 に更新後なのですが。。。
    テキストエリアに文字を入力した後で、画像ファイルをメディアピッカーよりアップロードし、「これを使用」を押すと、
    先に入力したテキストエリアの文字が消えてなくなります。。。

    回答いただけると助かります。

    masa
  38. Pingback: Daftar Koleksi 100 Plugins WordPress Terbaik untuk Website Anda | "welcome in 10 e acces"

  39. Pingback: Stingerにも搭載したいWordPressのおすすめプラグイン | SEO対策とアフィリエイトに強いWordPressテーマ「Stinger」

  40. Pingback: 超簡潔!Custom Field Templateの画像を表示する。 | おもしろハッカー

  41. 便利なプラグインありがとうございます。

    type = textarea でのエスケープ処理についてご確認ください。

    バージョン 2.1.6

    custom-field-template.phpの2310行目にてesc_attr()によるエスケープ処理が行われておりますが、WordPress標準のカスタムフィールドと同様にesc_textarea()のほうが正しいかと思います。

    >などの文字参照を入力した際に意図した挙動になりません。

    ふきのとう
  42. Pingback: ONDrecords【WEBまわりの事をやっております】WEBデザイン・通販システム・予約システム in 東京オフィス

  43. Pingback: カスタムフィールド固定,簡単にカスタマイズするプラグイン【Custom Field Template】 | ワードプレスとは

  44. Pingback: El Top 100 de los Plugins de WordPress para su Sitio | Eduarea's Blog

Comments are closed.