Linux 软件免费装

CFS Options Screens

开发者 jchristopher
更新时间 2022年2月11日 01:11
捐献地址: 去捐款
PHP版本: 3.9 及以上
WordPress版本: 5.9.0
版权: GPLv2 or later
版权网址: 版权信息

标签

Custom Field Suite CFS Options Settings Screen

下载

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

详情介绍:

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.

安装:

  1. Upload cfs-options-screens to the /wp-content/plugins/ directory
  2. 通过WordPress的“插件”菜单激活插件
  3. Register your options screen(s) using the code snippets from this readme

常见问题:

How do I add a Field Group to my options screen?

You must specify the Field Group Title(s) in the field_groups parameter when using the cfs_options_screens hook

How do I retrieve saved options?

$value = cfs_get_option( 'options_screen_name', 'field_name_from_field_group' );

更新日志:

1.2.7 1.2.5 1.2.4 1.2.3 1.2.1 1.2 1.1.2 1.1.1 1.1 1.0.3 1.0.2 1.0.1 1.0