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. I love this plugin, it has been a pleasure to use! I am having a tiny problem, and cant get my WYSIWYG editor to create line breaks, I can only do so in the HTML version. But if I make any updates to the page the HTML is wiped out. Is there a solution for this?

    My code:

    [reviews]
    type = textarea
    rows = 20
    cols = 40
    htmlEditor = true
    tinyMCE = true

    Thank you!

  2. 素晴らしプラグインをありがとうございます。
    本当にお世話になっています。

    ご相談なのですが、
    フィールドのグループ機能を使用すると、
    それ以降のカスタムフィールドの値が保存されないみたいです。

    いろいろ入力を試したところ、
    もう一度を入力すると、その値は保存されました。
    この動作は新規投稿の度に毎回確認しました。

    動作を確認したテンプレートは以下です。

    [table_set]
    type = fieldset_open
    legend = グループ1

    [table_set_01]
    type = textarea
    rows = 1
    cols = 45
    label = 項目1

    [table_set]
    type = fieldset_close

    [text]
    type = textarea
    rows = 2
    cols = 45
    label = 項目2

    このテンプレートでいうと、[text]の値が消えてしまいます。

    他に確認した動作は、
    [table_set]
    type = fieldset_close
    の部分を省いた場合、値は消えませんでした。

    WordPressのバーションは3.0.5です。
    他のプラグインをまったく入れてない状態でテスト致しました。

    対応方法などご教授いただけると幸いです。
    よろしくお願いいたします。

  3. tonoroさん、
    お返事遅くなりました。JavaScriptはテンプレートインストラクションに記述できるので試してみてください。

    Wordpress Go Go
  4. ムラッチさん、
    どうやら不具合があったようです。1.8.3で修正しましたので試してみてください。

    Wordpress Go Go
  5. お世話になります。
    ご返信ありがとうございます。
    カラーピッカーの件は試行錯誤中です(汗

    別件なのですが、投稿に画像を24点掲載しなくてはならず、このプラグインの
    type=fileでアップロードできるよう、下記のように設定しています。

    [item_image1]
    type = file
    label = 商品画像1
    ~~~
    [item_image24]
    type = file
    label = 商品画像24

    しかしながら、21点目以降の画像がアップロードされません。
    プラグイン側で、ファイルアップロードの回数にリミットが設定されているの
    でしょうか?
    リミットがかかっているのであれば、回避方法等お教えいただければと存じま
    す。

    お手数お掛けいたしますが、よろしくお願いいたします。

    tonoro
  6. お世話になります。
    連投恐縮です。

    本日午前中に書き込んだ件ですが、phpinfo()で確認したところ、見事に
    max_file_uploads = 20 となっておりました。

    お騒がせいたしました。
    今後ともどうぞよろしくお願いいたします。

    tonoro
  7. Hi, I love your plugin and I’ve used it on many sites. However, on my current project the client is very concerned about security implications because of the use of the eval() function.

    What is the purpose of using eval() in your plugin? Is it only so users can add their own PHP code? Is it necessary for the functionality of the plugin? In other words, would the plugin break if I stripped out the eval() calls?

    Thanks very much for this plugin, your time and your response to my questions.

    Rus Miller
  8. いつもありがとうございます。

    本日3.1へのアップデートと同時に、1.8.3にアップデートさせていただきましたところ、フィールドの値に改行が入るようになりました。

    あまり詳しくないものですから、これが仕様なのか、私だけの現象なのかなどよく分からないのですが、もしおわかりでしたら解決方法を教えていただけると幸いです。

    どうぞよろしくお願いいたします。

    t01
  9. こんにちは。
    お世話になります。

    現在、phpファイルでのkeyの引っ張り方について問題を抱えております。
    お知恵拝借できますと幸いでございます。

    いま、[mainimage1]に
    type=fileを設定して、
    ある投稿記事(idは2)にて画像ファイルを指定しています。

    その画像をphpやテンプレートファイルの中で使うためにデータをひっぱってこようとこころみているのですが、うまくいきません。

    WordPressのテンプレートファイル single.phpに
    [cft post_id=2 key=”mainimage1″ image_size=”full”]と書いてみたものの
    そのまま表示されてしまいます。

    ならばと、としたものの
    画像ファイルのIDを返す(186と表示)だけで、画像自体はひっぱってこれません。

    Custom Filed Templateをつかって、このように投稿画面以外で画像データをひっぱってくるのが不可能なのかもとあきらめかけているのですが、

    アドバイスいただけますと嬉しいです。

    よろしくお願い致します。

    もだめちゃん
  10. たびたびすみません。m(__)m

    前掲の

    ならばと、、の後にはこちら↓のコードを入れておりました。

    <?php echo get_post_meta(2, ‘mainimage1’, true); ?>

    失礼いたしました。

    もだめちゃん
  11. Pingback: カスタムフィールドテンプレート | DICO

  12. hi, thanks for your great plugin

    i want to ask a question how to show all checkbox items, including checked and unchecked items with different classes?

    for example:
    i have a checkbox

    [car]
    type = checkbox
    size = 35
    label = Car
    blank = true
    value = bmw # merc # audi

    merc is checked

    and i want to ouput

    bmw
    merc
    audi

    thanks very much

    Henry
  13. hmm sorry to buzz again, i cant insert html here

    what i mean is the output

    ul list

    merc is a Li with class “unchecked”
    bmw and audis are Li with class “checked”

    thanks

    Henry
  14. The text in every textarea goes out of it so I can not see last words of a row. How can I fix it?
    And anyone knows how to show again the resize arrow?

    Thanks

    Nico
  15. Pingback: カスタムフィールドを使いやすく「Custom Field Template」 | WP MEMO

  16. Hi,
    I’m wondering if you have any thoughts on restricting the set up pages to network admins in network-enabled WordPress installs. We definitely do not want to give people the option of adding PHP code, and most of our users wouldn’t understand how to use the plugin. I’d be happy to help with the code changes to restrict it to network admins if you’d roll the changes into your version….

    Deanna
  17. Hello,

    I may be missing something, but how do I add more templates after #0 and #1? In “Custom field template options” there’s a + side on the top right corner of the box, but that doesn’t add anything – if I need to change the code, where would I change it?

    Thanks!

    adeens
  18. はじめまして。とてもすばらしいプラグインをありがとうございます。

    質問があります。

    使用しているバージョンは、1.8.5。
    WordPressは、3.1.1です。

    ファイルのアップロード機能を使用しています。

    ファイルの選択をして「更新」をクリックすると、そこでアップロードしたファイルの情報の表示が消えてしまいます。
    もちろん、アップロードしたファイルが消えてしまうわけではありません。
    ですが、空欄になっているために、アップロードしてないのかと思い、何回も同じファイルを選択してしまったりしてしまいます。

    この部分に選択したファイルのファイル名を表示するなどの方法はありますでしょうか?

    また、この欄を入力必須にしたいのですが、方法がありましたらご教授いただけないでしょうか。

    不躾なお願いで申し訳ありません。
    よろしくお願いいたします。

    くぅ
  19. Pingback: カスタムフィールドを使いやすくするCustom Field Template pluginを試してみます | けいこうとなるも

  20. Pingback: Wie kann ich die Dateigröße eines Anhangs oder eines Links anzeigen lassen? « My Wordpress codex’s Blog

  21. Pingback: カスタムフィールドとPost typeを割と簡単に設置できるプラグイン-Wordpress « Web制作覚え書き

  22. こちらのプラグインは、とても使いやすく、愛用しております。

    ところで、WP3.11と、プラグイン最新バージョン,ThemeはTwentytenを使っていますが、デバッグモードをonにすると、

    Notice: Undefined index: ~
    というようなエラーが多数表示されます。

    たとえば、最初の5行くらい抜き出しますと、以下のような感じです。

    Notice: Undefined index: custom_field_template_set_options_submit in /wp-content/plugins/custom-field-template/custom-field-template.php on line 733

    Notice: Undefined index: custom_field_template_global_settings_submit in /wp-content/plugins/custom-field-template/custom-field-template.php on line 755

    Notice: Undefined index: custom_field_template_css_submit in wp-content/plugins/custom-field-template/custom-field-template.php on line 775

    Notice: Undefined index: custom_field_template_shortcode_format_submit in /wp-content/plugins/custom-field-template/custom-field-template.php on line 779

    Notice: Undefined index: custom_field_template_php_submit in /natuteria/wp-content/plugins/custom-field-template/custom-field-template.php on line 791

    デバッグモードを切って使う分には動作は問題が無さそうですが、気になります。

    これはあまり気にしない方が良いのでしょうか?それともこちらの環境に何か問題があるのでしょうか?

    次元
  23. いつもお世話になっております。

    ■fieldsetを使って、textやfileをグループ化して、必要に応じて項目数を増
    やせるように設定しました。
    [field0]
    type = fieldset_open
    legend = 見出し
    multipleButton = true

    [value1]
    type = file
    label = 画像

    [value2]
    type = text
    label = 項目

    [field0]
    type = fieldset_close

    ■single.php内で
    $cf = get_post_custom( $post->ID );
    $value1 = $cf[‘value1’];
    $value2 = $cf[‘value2’];
    $field0 = $cf[‘field0′];
    $lengh = $field0[0] );

    //ソートのための配列生成
    $values = array();
    for( $j = 0; $j < $length; $j ++ ){
    $v = $value1[$j] . "|" . $value2[$j] ;
    array_push( $values, $v );
    }
    //$value1でソート
    sort( $values );

    //表示
    for( $i = 0; $i < $length; $i ++ ){
    $value = $values[$i];
    $v = explode( "|", $value );
    echo '’;
    echo ” . $v[0] . ”;
    echo ” . $v[1] . ”;
    echo ”;
    }
    として表示しています。

    field0が5つ必要な投稿で、1つ目から順番に登録した際は、グループ化した通
    りに表示されますが、追加や削除を繰り返した場合、また一度投稿を保存した後
    にカスタムフィールドの値をあとから更新した場合、値がグループ化されず、
    バラバラな組み合わせで表示されてしまいます。

    DB内のpost_metaテーブルを直接観て、上記single.phpのコードではこのような
    表示になってしまうことはわかりました。

    グループ化した項目を複製し、グループ化した順序で表示するには、
    1)プラグイン側でどのように設定したらよいか?
    2)テーマ側でどのようなコードを書いたらよいか?
    ご教授願えればと存じます。

    お忙しいところ恐縮ですが、よろしくお願いいたします。

    tonoro
  24. くぅ さんへ
    お返事遅くなりました。おそらく画像以外のファイルの表示がきちんと行われない不具合だと思います。最新の1.8.7にアップグレードしていただければ、と思います。

    Wordpress Go Go
  25. 次元さんへ
    エラーが出ないように修正したいと思いますが、通常の使用ではデバッグ環境を使わないようにしていただければ、と思います。

    Wordpress Go Go
  26. お世話になります。
    ご返信いただきありがとうございました。
    type = textとtype = textareaに関しては、blank = trueを指定することによ
    り、期待通りの表示になりました。

    ただ画像を含んだグループを削除したり追加したりすると、投稿画面・公開側
    ともに画像の順序がずれてしまいます。

    ■投稿画面
    ——————–
    商品名1
    商品説明1
    商品画像1
    ——————–
    商品名2
    商品説明2
    商品画像2
    ——————–
    商品名3
    商品説明3
    商品画像3
    ——————–
    商品名4
    商品説明4
    商品画像4
    ——————–

    として「公開(更新)」
    この状態で投稿画面で2番目のグループを削除して「更新」すると

    ——————–
    商品名1
    商品説明1
    商品画像1
    ——————–
    商品名3
    商品説明3
    (画像なし)
    ——————–
    商品名4
    商品説明4
    商品画像3
    ——————–
    となります(画像がずれている)。

    この状態でphpMyAdminでpostmetaテーブルをmeta_idでソートして表示すると、
    type = textとtype = textareaで追加したデータは期待通りの順序で存在して
    いますが、画像は削除したグループの次のグループのフィールドが空になって
    います。
    meta_key,meta_value
    商品名,商品名1
    商品名,商品名3
    商品名,商品名4
    商品説明,商品説明1
    商品説明,商品説明3
    商品説明,商品説明4
    画像,数字
    画像,(空白)
    画像,数字
    という状態です。

    因みに上記の際のCustom Field Templeteは以下の通りです。
    ———————————————————————-
    [field0]
    type = fieldset_open
    legend = 商品
    multipleButton = true

    [商品名]
    type = text
    size = 80
    blank = true

    [商品説明]
    type = textarea
    rows = 7
    cols = 70
    blank = true

    [画像]
    type = file
    mediaLibrary = true
    relation = true
    blank = true

    [field0]
    type = fieldset_close
    ———————————————————————-

    画像が消えないオプションの組み合わせ等ご教授いただければ幸いです。
    お忙しいところ度々恐縮ですがよろしくお願いいたします。

    WordPress ver:3.1.2
    プラグインver:1.8.7
    サーバー:heteml(php5.2.8/MySQL5.0.51a)

    tonoro
  27. Hi Hiroaki,

    I hope you are well.

    I’ve come across a number of issues with your fantastic plugin, and was wondering if you are aware of them:

    1. When using the [code] option to create values for a [select] list, the $valueLabel array is being ignored. I have used the same PHP code across a number of sites and it works fine, but on the new site that I'm working on with the latest version of your plugin (1.8.7) it seems to fail. Has something changed?

    2. On the same installation, I can't seem to get a multiple version of the [fieldset] option to work properly. I've used your sample code, and the fieldset displays ok, but nothing happens when I click 'Add new'. Are you aware of this? What does the 'Add new' link use to create a new fieldset?

    3. Finally, is there a way to create two date fields and have the startDate of the second field set to be no earlier than the date defined in the first field?

    Thanks in advance for your time.

    Kind regards, Stephen

    Stephen
  28. Hello again,

    Just a quick update:

    I have reverted back to version 1.8.3 of the plugin, and the first two issues are no longer apparent. It seems that the problems have been introduced in a subsequent version.

    I hope this helps!

    Kind regards, Stephen

    Stephen
  29. Pingback: 今日のつぶやき 2011-05-15 | 花鳥風月

  30. Hi Stephen,
    Please upgrade to the latest version 1.8.8. I fixed the inconsistency of valueLabel and valueLabels. You can use both variables.

    Wordpress Go Go
  31. お世話になります。
    早速1.8.8を試させていただきました。
    おぉ、ちゃんと画像が残ってます!フィールド値が保存されています!!
    更に素晴らしいプラグインになったと思います。
    ご対応ありがとうございました。

    tonoro
  32. Pingback: TAM テクニカルチーム | WordPress 3.1 カスタム投稿タイプで CMS機能が充実 | Tips Note

  33. Pingback: Custom Field Template Forever | WP! WP!

  34. A bug: when entering “Custom Post Type (comma-deliminated):”, it requires the name to be in lower case, even if the custom post type has a name with upper case in it.

    thanks!

    Jonathan Butterick
  35. Hello,

    I really like your plugin, but I have a little problem with it.

    When I use array of checkboxes do display multiple values ($test = get_post_meta($post->ID, ‘Test’, false);), sorting is acting really weird. When I save checked values for the first time, it would display values in the same order as in the back-end. But if I save post one more time, it will rearrange values in reverse order. Now if I mark additional checkboxes: old ones get rearranged, while new ones are displayed correctly. But that changes again if I save my post one more time.

    Btw, [cft key=Test] shortcode sorting is fine.

    Oh, and “sort = desc/asc/order” does not work.

    Domas
  36. Hi!

    First, thank you for this awesome plugin!

    The radio and chekbox fields are separated by so it is always displaying vertically. But I needed the place, so I figured out a solution to put it in line:

    add_action(‘admin_head’, ‘my_admin_head’);
    function my_admin_head()
    {
    echo ‘
    .dl_radio br {
    display: none;
    }
    .dl_radio dd label.selectit
    {
    margin-right:16px;
    }
    ‘;
    }

    Thank you!

    Gergely Rossel

    Rossie
  37. いつもお世話になります。

    ■fieldsetによるグループ化について(multipleButton = true)
    グループ化した項目を「追加」して2項目にすると、最初の項目は「削除」の
    リンクがつき削除できますが、2つ目の項目(=最後の項目)には「追加」のリン
    クはつきますが「削除」のリンクがありません。
    フォーム内の値を空にして保存しても、「blank=true」にしているため、空の
    値が残ってしまい完全に削除できません。
    表示テンプレート側で「空白なら表示しない」と条件をつけて吸収してやるし
    かありませんか?
    最後の項目を完全に削除する方法をご教授いただければと存じます。
    お忙しいところ恐縮ですが、よろしくお願いいたします。

    tonoro
  38. Pingback: Membership Directory For WP3.0 | Adam White's Personal Blog

  39. Pingback: WordPressでCMSサイトを作るときの8つのお薦めプラグイン | WordPress | murak.net

  40. I am using wordpress-3.2 and have used short code [cft] but custom fields data is not displayed in post page.

    Please help me.

    Thanks in Advance!

    Abid Khan

Comments are closed.