[WordPress] 外掛分享: CFS Options Screens

前言介紹

  • 這款 WordPress 外掛「CFS Options Screens」是 2014-07-23 上架。
  • 目前有 500 個安裝啟用數。
  • 上一次更新是 2022-02-10,距離現在已有 1178 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.9 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

jchristopher |

外掛標籤

cfs | screen | options | settings | custom field suite |

內容簡介

使用Custom Field Suite構建任意數量的選項屏幕。

例如

首先創建你想在選項屏幕上包含的欄位組(Field Group),確保設置NO Placement Rules。創建後,注意使用的文章ID。然後,像這樣註冊任意數量的選項屏幕:

function my_cfs_options_screens( $screens ) {
$screens[] = array(
'name' => 'options',
'menu_title' => __( 'Site Options' ),
'page_title' => __( 'Customize Site Options' ),
'menu_position' => 100,
'icon' => 'dashicons-admin-generic', // 可選, dashicons-admin-generic是默認值
'field_groups' => array( 'My Field Group' ), // 使用此頁面上CFS Field Group的欄位組名稱(也可以是文章ID)
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

像這樣檢索你的選項:
$value = cfs_get_option( 'options_screen_name', 'cfs_field_name_from_field_group' );

通過在註冊時添加parent參數,您還可以在頂級和/或子級選項頁面中設置多個選項頁面:

function my_cfs_options_screens( $screens ) {

// Parent
$screens[] = array(
'name' => 'options',
'field_groups' => array( 'My Parent Field Group Name' ),
);

// Child
$screens[] = array(
'name' => 'options-nav',
'parent' => 'options', // 父級名稱
'field_groups' => array( 'My Child Field Group Name' ),
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

您還可以使用CFS選項屏幕設置字段組的默認值,從而使字段組同時出現在CFS選項屏幕和文章編輯屏幕上。 CFS選項屏幕將作為默認/後備,文章編輯屏幕將覆蓋這些默認值。

function my_cfs_options_screens( $screens ) {
$screens[] = array(
'name' => 'options',
'menu_title' => __( 'Site Options' ),
'page_title' => __( 'Customize Site Options' ),
'menu_position' => 100,
'icon' => 'dashicons-admin-generic', // 可選, dashicons-admin-generic是默認值
'field_groups' => array(
array(
'title' => 'My CFS Field Group Name',
'has_overrides' => true,
),
),
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

請檢查cfs_options_screens_override_note_default和cfs_options_screens_override_note_override過濾器以自定義消息,以覆蓋CFS選項屏幕的默認值。

原文外掛簡介

Build any number of options screens based on Custom Field Suite.
For Example
Begin by creating Field Group(s) you want to include on your options screen. Be sure to set NO Placement Rules. Once it’s created, note the post ID it uses. You can then register any number of options screens like so:
function my_cfs_options_screens( $screens ) {
$screens[] = array(
'name' => 'options',
'menu_title' => __( 'Site Options' ),
'page_title' => __( 'Customize Site Options' ),
'menu_position' => 100,
'icon' => 'dashicons-admin-generic', // optional, dashicons-admin-generic is the default
'field_groups' => array( 'My Field Group' ), // Field Group name(s) of CFS Field Group to use on this page (can also be post IDs)
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

Retrieve your options like so:
$value = cfs_get_option( 'options_screen_name', 'cfs_field_name_from_field_group' );

You can set up multiple top level and/or children options pages by adding a parent argument when registering your screen:
function my_cfs_options_screens( $screens ) {

// Parent
$screens[] = array(
'name' => 'options',
'field_groups' => array( 'My Parent Field Group Name' ),
);

// Child
$screens[] = array(
'name' => 'options-nav',
'parent' => 'options', // name of the parent
'field_groups' => array( 'My Child Field Group Name' ),
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

You can also use CFS Options Screens to set up Field Group ‘defaults’, allowing a Field Group to appear both on a CFS Options Screen and a post edit screen. The CFS Options Screen will act as the default/fallback and the post edit screen will override those defaults.
function my_cfs_options_screens( $screens ) {
$screens[] = array(
'name' => 'options',
'menu_title' => __( 'Site Options' ),
'page_title' => __( 'Customize Site Options' ),
'menu_position' => 100,
'icon' => 'dashicons-admin-generic', // optional, dashicons-admin-generic is the default
'field_groups' => array(
array(
'title' => 'My CFS Field Group Name',
'has_overrides' => true,
),
),
);

return $screens;
}

add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );

Check out the cfs_options_screens_override_note_default and cfs_options_screens_override_note_override filters to customize the messaging for CFS Options Screens overrides.

各版本下載點

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

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


1.0 | 1.1 | 1.2 | 1.0.1 | 1.0.2 | 1.0.3 | 1.1.1 | 1.1.2 | 1.2.1 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.2.6 | 1.2.7 | trunk |

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

  • Redux Framework 》Redux – 快速在 WordPress 的 Gutenberg 中建立完整頁面, , 使用我們不斷更新的 WordPress 區塊模板、版面配置和模式強化 Gutenberg 編輯器。發現無限可能,...。
  • CMB2 》CMB2 是一個開發人員的工具包,用於在 WordPress 上構建 metabox,自定義字段和表單,可以讓您震撼。輕鬆管理帖子、條款、用戶、評論的元數據,或創建自定義...。
  • OptionTree 》OptionTree 嘗試建立一個完全響應式的選項面板和元框,經由此可讓 WordPress 開發人員、設計師和最終使用者進行連結,此外其操作簡單的方式,也不顯得像其他...。
  • Options Framework 》「Options Framework Plugin」可讓您輕鬆在任何 WordPress 主題中加入選項面板,讓開發者集中心力在製作實際主題上,而非花費時間從頭開始創建選項面板。與 W...。
  • ACF Options For Polylang 》您使用了高級自訂欄位來建立選項頁面,並且安裝了 Polylang 外掛以獲得令人驚嘆的多語言網站嗎?, 可惜的是,Polylang 並不處理 ACF 的選項頁面。這意味著您...。
  • WPS Child Theme Generator 》中文, WPS Child Theme Generator 是一款高級工具,可以輕鬆創建所需的子佈景主題。它提供許多選項,可以添加到 functions.php 中,而無需修改它。您也可以將...。
  • WP Options Importer 》目前 WordPress 可透過 WXR 匯出其所有內容,然後再透過 WordPress, 匯入外掛進行導入。這個過程包括所有文章、術語、選單、評論和使用者,, 但不碰觸選項。...。
  • AAA Option Optimizer 》,
      ,
    • 該外掛追踪頁面上使用的自動載入選項,並在頁面渲染結束時存儲該數據。它保留一個已使用的選項數組。在管理頁面上,它...。
    • Custom Global Variables 》使用此 WordPress 外掛可以建立自己的自訂變數,管理網站上的資訊,例如:, , 電話號碼, 地址, 社交媒體連結, HTML 片段, 以及其他任何資訊, , 可以輕鬆地在 ...。
    • WPC Product Options for WooCommerce 》WPC Product Options for WooCommerce 是另一個對於任何一種網店來說都適用的重要外掛程式,它帶來的是調整價格的能力,搭配高度自定義的額外欄位來應用於簡...。
    • Redux Developer Mode Disabler 》Redux 是一個非常強大的框架。為了讓開發者更輕鬆使用,我們在庫存中內建了提交通知(commit notice)。不幸的是,有些開發者在使用時開啟了這些通知,因此這個...。
    • Expand Divi 》這是一個易於使用的外掛程式,可以增加Divi主題缺少的一些主題功能。, 查看所有包含的選項:https://wajba.club/ed/home/ , 預載程式:, 在頁面載入時旋轉一...。
    • Disabler 》我不喜歡某些東西,例如彎曲的“智能”引號和自我ping。因此,我想做一個外掛來覆蓋常見的問題,而不是安裝六到七個插件。Disabler 允許你從一個簡單的 UI 中挑...。
    • Contact Details 》新增輸入聯絡資訊功能以在文章、頁面或樣板中輸出詳細資料。, 使用捷徑 [contact type="phone"] 來顯示任何聯絡詳細資訊,或使用函式呼叫
    • Transient Cleaner 》從你的 WordPress options 資料庫表格中清理已過期的 transients。這個外掛是原創且最好用的!, “Transients (翻譯中:暫存資料) 是 WordPress 中儲存...。

文章
Filter
Apply Filters
Mastodon