[WordPress] 外掛分享: Smart Custom Fields

WordPress 外掛 Smart Custom Fields 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Smart Custom Fields」是 2014-10-08 上架。
  • 目前有 50000 個安裝啟用數。
  • 上一次更新是 2024-10-11,距離現在已有 203 天。
  • 外掛最低要求 WordPress 6.4 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 19 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

fuyuan9 | hogetan | inc2734 | mirucon | sysbird | hanamura | mimosafa | kurudrive | mayukojpn | toro_unit | designhehe | hideokamoto | robssanches | hisako-isaka | justinticktock | kengyu-nakamura |

外掛標籤

meta | field | custom | meta field | custom field |

內容簡介

Smart Custom Fields 是一個管理自訂欄位的簡單外掛。

功能

支援自訂欄位群組迴圈。
支援元資料修訂。
支援元資料預覽。

欄位類型

文字
文字區域
單選
下拉式選單
核取方塊
所見即所得編輯器
圖片
檔案
相關文章
相關標籤
顏色選擇器
日期選擇器
日期時間選擇器
布林值
訊息

如何取得元資料?

文章元資料

此方法可取得任何元資料。

SCF::get( '欄位名稱' )

此方法可取得任何群組的元資料。

SCF::get( '群組名稱' )

此方法可取得所有元資料。

SCF::gets()

使用者元資料

此方法可取得任何使用者元資料。

SCF::get_user_meta( $user_id, '欄位名稱' )

此方法可取得任何群組的使用者元資料。

SCF::get_user_meta( $user_id, '群組名稱' )

此方法可取得所有使用者元資料。

SCF::get_user_meta( $user_id )

分類法元資料

此方法可取得任何分類法元資料。

SCF::get_term_meta( $term_id, $taxonomy '欄位名稱' )

此方法可取得任何群組的分類法元資料。

SCF::get_term_meta( $term_id, $taxonomy, '群組名稱' )

此方法可取得所有分類法元資料。

SCF::get_term_meta( $term_id, $taxonomy )

自訂選項頁面元資料

此方法可取得任何自訂選項頁面元資料。

SCF::get_option_meta( $menu_slug, '欄位名稱' )

此方法可取得任何群組的自訂選項頁面元資料。

SCF::get_option_meta( $menu_slug, '群組名稱' )

此方法可取得所有自訂選項頁面元資料。

SCF::get_option_meta( $menu_slug )

建立自訂選項頁面
SCF::add_options_page( $頁面標題, $選單標題, $能力, $選單別名, $圖示網址 = '', $位置 = null );

以程式碼註冊自訂欄位。

.gist table { margin-bottom: 0; }

此文件包含雙向 Unicode 文字,可能與下方顯示的內容不同解釋或編譯。若要檢查,請在顯示隱藏 Unicode 字元的編輯器中開啟該文件。
了解有關雙向 Unicode 字元的更多資訊

顯示隱藏字元

/**

* 定義自訂欄位

*

* @param array $設定 Smart_Custom_Fields_Setting 物件陣列

* @param string $類型 文章類型或角色

* @param int $id 文章 ID 或使用者 ID

* @param string $meta_typedata[revealButtonData] = ""; 元資料型別

*/
add_action( 'init', function() {
    $settings = array();
    // 在此定義自訂欄位
    SCF::add_meta_box( '自訂欄位標題', '投稿類型', $settings, 'normal', 'high' );
} );

原文外掛簡介

Smart Custom Fields is a simple plugin for managing custom fields.
Features

Field group loop support.
Meta data revision support.
Meta data preview support.

Field Types

Text
Textarea
Radio
Select
Checkbox
WYSIWYG editor
Image
File
Related Posts
Related Terms
Color picker
Date picker
Datetime picker
Boolean
Message

How to get meta data ?
**The return value of each of the following methods is not sanitized. Please sanitize them if necessary. **

Escaping Data


Post meta data
This method can get any meta data.
SCF::get( 'field-name' )

This method can get meta data of any group.
SCF::get( 'group-name' )

This method can get all meta data.
SCF::gets()

User meta data
This method can get any user meta data.
SCF::get_user_meta( $user_id, 'field-name' )

This method can get user meta data of any group.
SCF::get_user_meta( $user_id, 'group-name' )

This method can get all user meta data.
SCF::get_user_meta( $user_id )

Term meta data
This method can get any term meta data.
SCF::get_term_meta( $term_id, $taxonomy 'field-name' )

This method can get term meta data of any group.
SCF::get_term_meta( $term_id, $taxonomy, 'group-name' )

This method can get all term meta data.
SCF::get_term_meta( $term_id, $taxonomy )

Custom options page meta data
This method can get any custom options page meta data.
SCF::get_option_meta( $menu_slug, 'field-name' )

This method can get custom options page meta data of any group.
SCF::get_option_meta( $menu_slug, 'group-name' )

This method can get all custom options page meta data.
SCF::get_option_meta( $menu_slug )

Create custom options page
SCF::add_options_page( $page_title, $menu_title, $capability, $menu_slug, $icon_url = '', $position = null );

Register custom fields by the code.
.gist table { margin-bottom: 0; }

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

add_group( 'ユニークなID', 繰り返し可能か, カスタムフィールドの配列 );

$Setting->add_group( 'group-name-1', false, array(

array(

'name' => 'field-1',

'label' => 'テストフィールド',

'type' => 'text',

),

array(

'name' => 'field-2',

'label' => 'テストフィール2',

'type' => 'text',

'default' => 2,

),

) );

$settings[] = $Setting;

return $settings;

}

add_filter( 'smart-cf-register-fields', 'my_register_fields', 10, 4 );

view raw

gistfile1.php

hosted with ❤ by GitHub

GitHub
https://github.com/inc2734/smart-custom-fields/
Translators

Japanese(ja) – JOTAKI Taisuke

You can translate this plugin into your language by using GlotPress.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Smart Custom Fields」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.1.0 | 1.1.1 | 1.1.2 | 1.1.3 | 1.2.0 | 1.2.1 | 1.2.2 | 1.3.0 | 1.3.1 | 1.3.2 | 1.4.0 | 1.5.0 | 1.5.1 | 1.5.2 | 1.6.0 | 1.6.1 | 1.6.2 | 1.6.3 | 1.6.4 | 1.6.5 | 1.6.6 | 1.6.7 | 1.7.0 | 2.0.0 | 2.0.1 | 2.1.0 | 2.1.1 | 2.2.0 | 2.2.1 | 2.2.2 | 2.2.3 | 2.3.0 | 3.0.0 | 3.0.1 | 3.1.0 | 3.1.1 | 3.1.2 | 3.1.3 | 3.1.4 | 3.1.5 | 3.1.6 | 3.1.7 | 4.0.0 | 4.0.1 | 4.0.2 | 4.1.0 | 4.1.1 | 4.1.2 | 4.1.3 | 4.1.4 | 4.1.5 | 4.2.0 | 4.2.1 | 4.2.2 | 5.0.0 | trunk |

延伸相關外掛(你可能也想知道)

  • Advanced Custom Fields: Image Aspect Ratio Crop Field 》這是一個進階自訂欄位 (Advanced Custom Fields) 的外掛,會在使用者上傳圖片後強制執行特定的長寬比例或像素大小裁剪。使用長寬比例對於回應式圖片的使用情...。
  • Masks Form Fields 》新增表單欄位的類別。, 使用 Contact Form 7 的範例:, [tel your-phone class:phone placeholder "Phone"], , 可用於使用的類別清單:, ('span.start, input.s...。
  • Quantity Field on Shop Page for WooCommerce 》這款外掛會在 WooCommerce 網店的購物頁面上顯示商品數量欄位,讓客戶可以在加入購物車前變更商品數量。。
  • Gravity Slider Fields 》Gravity Forms 目前還不支援滑桿欄位,但在此之前,這個外掛可以很好地發揮作用。, 這個外掛將在進階欄位群組中新增一個滑桿欄位。您可以使用以下一組選項自...。
  • Show User ID 》「Show User ID」是一款小型的外掛,可在 WordPress 儀表板的使用者部分的表格中顯示欄位 ID。它將被添加為每個使用者的其他數據的一列。, 功能, , 在使用者...。
  • reCAPTCHA for Ninja Forms 》更新:Ninja Forms 3.0 現在內建 Google reCAPTCHA 整合功能。如果您正在使用最新版本的 Ninja Forms,則不必再安裝此外掛程式以進行 reCAPTCHA 整合, 在 Nin...。
  • Gravity Forms Data Persistence Add-On Reloaded 》請思考這樣的情境:, a) 你的網站使用多頁 Gravity Forms。, b) 使用者登入網站,並開始填寫一個有 5 個步驟的表單。, c) 在第三步,使用者離開網站,並未完...。
  • Comments Shortcode 》這個外掛程式允許您在 WordPress 的任何位置顯示評論和評論表單。可以在不修改代碼的情況下顯示 WordPress 頁面和文章的評論列表,並且它與大部分可用的佈景...。
  • Advanced Custom Fields: reCAPTCHA Field 》ACF reCAPTCHA將Google reCAPTCHA帶入Advanced Custom Fields,以用於前端表單。, 功能包括:, , ACF reCAPTCHA Protection確保垃圾郵件機器人無法繞過reCAPT...。
  • Advanced Custom Fields – Location Field add-on 》這是一個針對Advanced Custom Fields WordPress 外掛的擴充套件,除非已安裝且啟用 Advanced Custom Fields,否則對 WordPress 不提供任何功能。, Location ...。
  • Flexible Content Extended for Advanced Custom Fields 》透過將版面配置列表轉換為帶有圖像預覽的對話框,擴展了 ACF 靈活內容欄位 (Flexible Content Field)的功能。同時,在對版面配置進行編輯時,亦採用了更好的...。
  • Contact Form 7 WooCommerce Order Dropdown Field 》將 Woocommerce 訂單下拉選單添加到熱門的 Contact Form 7 外掛。這個欄位會建立一個下拉選單來顯示當前使用者的訂單。, 這個外掛將讓 Contact Form7 表單更...。
  • Add Quantity Field on Shop Page for WooCommerce 》您想在 WooCommerce 商店頁面上添加數量欄位嗎?, 使用此外掛程式,您可以輕鬆在 WooCommerce 商店頁面上顯示數量欄位。如果您在商店頁面上啟用變體選項,此...。
  • Html Template for Contact Form 7 》這個外掛程式有助於在 Contact Form 7 中傳送美觀而簡單的 HTML 電子郵件,如果電子郵件類型是 HTML 的話。, 使用此外掛程式的配置,對於每個表單,都可以選...。
  • Remove Web Field From Comments Form 》「移除評論表單中的網站欄位」是一個小型的外掛程式,可以讓您移除所有評論表單中的網站欄位,因此您再也不必處理不需要的網站連結。您可以勾選「設定 > 一般...。

文章
Filter
Apply Filters
Mastodon