Title: Smart Custom Fields
Author: Takashi Kitajima
Published: <strong>Oktobro 9, 2014</strong>
Last modified: Marto 18, 2026

---

Priserĉi kromprogramojn

![](https://ps.w.org/smart-custom-fields/assets/banner-772x250.png?rev=1799490)

![](https://s.w.org/plugins/geopattern-icon/smart-custom-fields_043846.svg)

# Smart Custom Fields

 De [Takashi Kitajima](https://profiles.wordpress.org/inc2734/)

[Elŝuti](https://downloads.wordpress.org/plugin/smart-custom-fields.5.0.7.zip)

 * [Detaloj](https://eo.wordpress.org/plugins/smart-custom-fields/#description)
 * [Pritaksoj](https://eo.wordpress.org/plugins/smart-custom-fields/#reviews)
 *  [Instalo](https://eo.wordpress.org/plugins/smart-custom-fields/#installation)
 * [Programado](https://eo.wordpress.org/plugins/smart-custom-fields/#developers)

 [Helpo](https://wordpress.org/support/plugin/smart-custom-fields/)

## Priskribo

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

 * Teksto
 * Tekstareo
 * Radiobutono
 * Elekti
 * Markskatolo
 * WYSIWYG editor
 * Bildo
 * Dosiero
 * Related Posts
 * Related Terms
 * Kolorelektilo
 * 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. **

https://developer.wordpress.org/apis/security/escaping/

**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.

 |   |  <?php |  
 |   |  /** |  
 |   |   * カスタムフィールドを定義 |  
 |   |   *  |  
 |   |   * @param array $settings Smart_Custom_Fields_Setting オブジェクトの配列 |  
 |   |   * @param string $type 投稿タイプ or ロール |  
 |   |   * @param int $id 投稿ID or ユーザーID |  
 |   |   * @param string $meta_type post | user |  
 |   |   * @return array |  
 |   |   */ |  
 |   |  function my_register_fields( $settings, $type, $id, $meta_type ) { |  
 |   |    |  
 |   |   // SCF::add_setting( 'ユニークなID', 'メタボックスのタイトル' ); |  
 |   |   $Setting = SCF::add_setting( 'id-1', 'functions.php から追加 その1' ); |  
 |   |    |  
 |   |   // $Setting->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](https://gist.github.com/inc2734/9f6d65c7473d060d0fd6/raw/10bdf9bf49f4b3a67ae89b8f7c6123f45438589a/gistfile1.php)

[ gistfile1.php  hosted with ❤ by [GitHub](https://github.com)

#### GitHub

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

#### Translators

 * Japanese(ja) – [JOTAKI Taisuke](https://profiles.wordpress.org/tai/)

You can translate this plugin into your language by using [GlotPress](https://translate.wordpress.org/projects/wp-plugins/smart-custom-fields).

## Ekrankopioj

 * [[
 * Smart Custom Fields settings page.
 * [[
 * Post edit page.

## Instalo

 1. Upload `Smart Custom Fields` to the `/wp-content/plugins/` directory
 2. Aktivigu la kromprogrameton tra la menuo ‘Kromprogrametoj’ en WordPress
 3. You can setting custom fields in ‘Smart Custom Fields’ page.

## Pritaksoj

![](https://secure.gravatar.com/avatar/e6e6286190b900f3c8378d1b1bc462e94576ea09d99d76b603050d80cefab7f8?
s=60&d=retro&r=g)

### 󠀁[very simple and great](https://wordpress.org/support/topic/very-simple-and-great/)󠁿

 [tommynguyen0710](https://profiles.wordpress.org/tommynguyen0710/) Septembro 29,
2025

very simple and great

![](https://secure.gravatar.com/avatar/009cee7d729ace50e12ee2371152895f764336a8750bacd4a4e0ef4a0df94915?
s=60&d=retro&r=g)

### 󠀁[Great simple product but needs update](https://wordpress.org/support/topic/great-simple-product-but-needs-update/)󠁿

 [jkaki](https://profiles.wordpress.org/jkaki/) Februaro 13, 2025

This is a great, simple product, but it hasn’t been updated for four months. At 
this time it has a critical vulnerability and needs to be updated.

![](https://secure.gravatar.com/avatar/f06dd72dda201b66f0081c4a5d9669aab83cec129fc2b362333581fe554d6287?
s=60&d=retro&r=g)

### 󠀁[image](https://wordpress.org/support/topic/image-67/)󠁿

 [xforeal](https://profiles.wordpress.org/xforeal/) Septembro 25, 2022

How can we display image field, like ACF: <?php $image = get_field(‘hero_image’);?
> ” alt=”<?php echo $image[‘alt’]; ?>” /> SCF: <?php echo SCF::get(‘img’)[0]; ?>
isn’t work.

![](https://secure.gravatar.com/avatar/953bcbc9c7ff6dd18d399ae5efa06ac47c2bba21dd4bb1ebbbd3390668b2c0a6?
s=60&d=retro&r=g)

### 󠀁[Helpful](https://wordpress.org/support/topic/helpful-197/)󠁿

 [Zhandos Ulan](https://profiles.wordpress.org/jandos/) Novembro 18, 2018

Really simple and useful plugin! Recommend to use for fast development

![](https://secure.gravatar.com/avatar/4e7e16090d64caea0e3e2dd06e68dad035f6231f6bdb4f1aecf9b728476676ab?
s=60&d=retro&r=g)

### 󠀁[Very nice plugin!](https://wordpress.org/support/topic/very-nice-plugin-539/)󠁿

 [Robssanches](https://profiles.wordpress.org/robssanches/) Julio 23, 2018

An excellent plugin for custom fields.

![](https://secure.gravatar.com/avatar/0e4189a98b66e319382b3f83c39fed7eefa99137c8fd6dea09ed44ab8d060db2?
s=60&d=retro&r=g)

### 󠀁[Great plugin!](https://wordpress.org/support/topic/great-plugin-17580/)󠁿

 [Ko Takagi](https://profiles.wordpress.org/ko31/) Aprilo 12, 2018

It’s very simple and useful plugin.

 [ Legi ĉiujn 20 pritaksojn ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/)

## Kontribuantoj k. programistoj

“Smart Custom Fields” estas liberkoda programo. La sekvaj homoj kontribuis al la
kromprogramo.

Kontribuantoj

 *   [ Takashi Kitajima ](https://profiles.wordpress.org/inc2734/)
 *   [ Toro_Unit (Hiroshi Urabe) ](https://profiles.wordpress.org/toro_unit/)
 *   [ Toshimichi Mimoto ](https://profiles.wordpress.org/mimosafa/)
 *   [ hide ](https://profiles.wordpress.org/hideokamoto/)
 *   [ Hisako Isaka ](https://profiles.wordpress.org/hisako-isaka/)
 *   [ Hidekazu Ishikawa ](https://profiles.wordpress.org/kurudrive/)
 *   [ hanamura ](https://profiles.wordpress.org/hanamura/)
 *   [ Justin Fletcher ](https://profiles.wordpress.org/justinticktock/)
 *   [ designhehe ](https://profiles.wordpress.org/designhehe/)
 *   [ Mayo Moriyama ](https://profiles.wordpress.org/mayukojpn/)
 *   [ yousan ](https://profiles.wordpress.org/hogetan/)
 *   [ Robssanches ](https://profiles.wordpress.org/robssanches/)
 *   [ Toshihiro Kanai ](https://profiles.wordpress.org/mirucon/)
 *   [ sysbird ](https://profiles.wordpress.org/sysbird/)
 *   [ Kengyu Nakamura ](https://profiles.wordpress.org/kengyu-nakamura/)
 *   [ fuyuan9 ](https://profiles.wordpress.org/fuyuan9/)
 *   [ まーちゅう ](https://profiles.wordpress.org/rocketmartue/)
 *   [ けい (Kei Nomura) ](https://profiles.wordpress.org/mypacecreator/)

“Smart Custom Fields” has been translated into 7 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/smart-custom-fields/contributors)
for their contributions.

[Traduki “Smart Custom Fields” en vian lingvon.](https://translate.wordpress.org/projects/wp-plugins/smart-custom-fields)

### Ĉu interesita en programado?

[Browse the code](https://plugins.trac.wordpress.org/browser/smart-custom-fields/),
check out the [SVN repository](https://plugins.svn.wordpress.org/smart-custom-fields/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/smart-custom-fields/)
by [RSS](https://plugins.trac.wordpress.org/log/smart-custom-fields/?limit=100&mode=stop_on_copy&format=rss).

## Ŝanĝprotokolo

#### 5.0.7

 * Vulnerability fixes

#### 5.0.6

 * Fixed a bug that caused a fatal error if post-type was not specified in related
   posts. [inc2734/smart-custom-fields#110](https://github.com/inc2734/smart-custom-fields/issues/110)

#### 5.0.5

 * Fixed a bug that caused a fatal error if post-type was not specified in related
   posts. [inc2734/smart-custom-fields#110](https://github.com/inc2734/smart-custom-fields/issues/110)
 * Removed auto-draft check from `is_saved_the_key()` [inc2734/smart-custom-fields#113](https://github.com/inc2734/smart-custom-fields/pull/113)

#### 5.0.4

 * Fixed a bug in v5.0.1 and later where JavaScript related to the TinyMCE editor
   did not work properly in Firefox.

#### 5.0.3

 * Fixed a bug that caused a fatal error when using `SCF::add_options_page()`.

#### 5.0.2

 * Fixed a Notice error regarding translation.
 * Fixed xss vulnerability.
 * Fixed an issue where WYSIWYG fields were not working properly in the block editor.
 * Fixed an issue where sorting would not work properly when multiple field groups
   were set on the same options page and Post Attributes > Order was specified.

#### 5.0.0

 * WordPress 6.4 or higher is now required.
 * PHP 7.4 or higher is now required.
 * Security fix.

#### 4.2.2

 * Fix fatal error that occurred when using with bogo.

#### 4.2.1

 * Fix Worning/Fatal error on PHP7/8.
 * Fix sanitize missing in the textarea field.
 * Add list to the wysiwyg field.

= 4.1.6
 * Some updates by [@kengyu](https://github.com/kengyu) * Add filter hook
smart-cf-rest_api_post_type by [@fuyuan9](https://github.com/fuyuan9)

#### 4.1.5

 * Fix ajax bug.

#### 4.1.4

 * WordPress 5.5 support
 * Changed so that the reusable block post type is not displayed in the conditional
   judgment.

#### 4.1.3

 * Activate datetimepicker in repeat group #80

#### 4.1.2

 * Fix PHP syntax error.

#### 4.1.0

 * feat: Implement new field datetime picker
 * feat: Add filters for related posts fields with name and post types

#### 4.0.2

 * Some updates by [@robssanches](https://github.com/robssanches)

#### 4.0.0

 * Add message field. #64 (by [@robssanches](https://github.com/robssanches))
 * Fix boolean field bug with `smart-cf-register-fields` filter hook.
 * Refactoring displaying options process of each fields.

#### 3.1.7

 * Fixing issues and adding support for the Brazilian Portuguese language #63 (by
   [@robssanches](https://github.com/robssanches))
 * Spelling fixes in Readme #62 (by [@garrett-eclipse](https://github.com/garrett-eclipse))

#### 3.1.6

 * Set any on related post status. #60 (by [@mayukojpn](https://github.com/mayukojpn))
 * Changed that file names can be known when uploading files. #58 (by [@shodoi](https://github.com/shodoi))

#### 3.1.5

 * Fixed a bug that disappeared layout when introducing description in relation 
   field. #56 (by [@mayukojpn](https://github.com/mayukojpn))
 * Update item delete button style in relation field.
 * Fix bug when using smart-cf-register-fields hook.

#### 3.1.4

 * Remove no used codes.
 * Fixed a bug that name disappears when opening / closing a field. #51 (by [@yousan](https://github.com/yousan))

#### 3.1.3

 * Fix Selectable number bug

#### 3.1.2

 * Update readme.txt

#### 3.1.1

 * Fixed a bug of limit attribute at relation post types and taxonomies field.

#### 3.1.0

 * Added limit attribute at relation post types and taxonomies field.

#### 3.0.1

 * Fixed a bug that icon and display position of created option page are not reflected#
   47 (by [@designhehe](https://github.com/designhehe))

#### 3.0.0

 * Support multiple user roles.
 * Update filter hook smart-cf-register-fields

#### 2.3.0

 * Support displayed thumbnail when value of file and image field is file url.

#### 2.2.3

 * Fix get_post_metadata hooked only preview #43 (by [@wireframeslayout](https://github.com/wireframeslayout))

#### 2.2.2

 * Fix #37 #38

#### 2.2.1

 * Fix bug boolean field in repeatable group #39
 * Fix bug datepicker and colorpicker in repeatable group #41

#### 2.2.0

 * Refactoring tests.
 * Changed behavior of the default value of new field of the already saved object.
   Using the default value.

#### 2.1.1

 * Fix revision lines duplication (by [@hanamura](https://github.com/hanamura))
 * Fixed a bug that relation fields don’t work on the options page.

#### 2.1.0

 * Support separated key and value in select, checkbox, radio.
 * Added switching editor mode tab in wysiwyg field.
 * Added instruction of field option.

#### 2.0.0

 * Refactoring
 * Added meta data of custom options page.

#### 1.7.0

 * Added taxonomy relation field.
 * Added textarea rows setting.
 * Fixed a bug that tinymce js error when disabled rich editing.

#### 1.6.7

 * Removed console.log in a js file.

#### 1.6.6

 * Fixed a bug that warning is out when the array isn’t returned in the smart-cf-
   register-fields.

#### 1.6.5

 * Fixed a bug that multi value in the loop is broken.
 * In setting screen, if the field is closed, display the field name.

#### 1.6.4

 * Fixed a bug that wysiwyg fields became tinymce default format when content editor
   mode is text.
 * Change the comment in English.

#### 1.6.3

 * Fixed a bug that metadata that isn’t defined by Smart Custom Fields can’t get
   in preview.

#### 1.6.2

 * Fixed a bug that sometimes can’t get data when there are multiple Smart Custom
   Fields settings.

#### 1.6.1

 * Fixed a bug that custom field settings vanished when saved.

#### 1.6.0

 * Added search feature in the relation field.
 * Changed when the object isn’t saved, default value is active.
 * Remove filter hook smart-cf-is_use_default_when_not_saved.
 * Fixed a bug that isn’t displayed meta data in preview when using custom fields
   settings with post id.

#### 1.5.3

 * Fixed a wysiwyg field bug.

#### 1.5.2

 * Fixed a wysiwyg field bug.

#### 1.5.1

 * Fixed a relation field bug.

#### 1.5.0

 * Update wysiwyg field.

#### 1.4.0

 * refactoring controllers.
 * Add term custom fields.
 * Add filter hook smart-cf-is_use_default_when_not_saved
 * Changed to the default value is used if the value has not been saved. If you 
   want to revert to the previous behavior, return false in smart-cf-is_use_default_when_not_saved.

#### 1.3.2

 * Add preview size setting in the image field.
 * Add display direction setting in the checkbox and radio field.
 * Changed the upload field that displayed uploaded to this post first.

#### 1.3.1

 * Fixed a wysiwyg field bug.
 * Add boolean field.

#### 1.3.0

 * refactoring.
 * Add profile custom fields.
 * Add filter hook smart-cf-validate-get-value
 * Add method SCF::get_user_meta( $user_id, $name = null )
 * Fixed a revision bug.
 * Fixed a bug that thumbnail is not displayed correctly in preview.
 * Fixed a relation field bug.
 * Changed return value of SCF::get with multiple data in loop.
 * Changed revision screen format.

#### 1.2.2

 * Fixed a bug that can not get the correct data when the posts use post id filtering.
 * Changed that original the_content filter does not apply to wysiwyg field.
 * Add post_id attribute to smart-cf-register-fields.

#### 1.2.1

 * Fixed a bug that post id filtering incorrect.

#### 1.2.0

 * refactoring. A lot of changes in all.
 * Renewed the Smart_Custom_Fields_Field_Base.
 * Add filter hook smart-cf-register-fields. If You use this hook, you can define
   custom fields by the code.
 * Add action hook smart-cf-before-editor-enqueue-scripts
 * Add action hook smart-cf-after-editor-enqueue-scripts
 * Add action hook smart-cf-before-settings-enqueue-scripts
 * Add action hook smart-cf-after-settings-enqueue-scripts

#### 1.1.3

 * Change method SCF::get_field to SCF::get_value_by_field
 * Change method SCF::get_sub_field to SCF::get_values_by_group
 * Add method SCF::get_field
 * Add method SCF::choices_eol_to_array
 * remove method Smart_Custom_Fields_Field_Base::get_choices

#### 1.1.2

 * Add action hook smart-cf-fields-loaded

#### 1.1.1

 * UX Improvement of settings page.

#### 1.1.0

 * Add date picker field.

#### 1.0.3

 * Fixed a bug that can’t be get the correct data when specify a $post_id attribute
   to SCF::get(). For example SCF::get( ‘key’, $post_id )

#### 1.0.2

 * Add color picker field.
 * Add smart-cf-before-save-post action hook.
 * Add smart-cf-after-save-post action hook.
 * Add smart-cf-validate-save-post filter hook.

#### 1.0.1

 * Add display condition by post id.
 * Fixed bug that is not displayed wysiwyg editor when there are not content editor.
 * Textarea does not filter the_content filter in SCF::get() and SCF::gets().

#### 1.0.0

 * Unua eldono.

## Metadatumoj

 *  Version **5.0.7**
 *  Last updated **antaŭ 2 semajnoj**
 *  Active installations **50.000+**
 *  WordPress version ** 6.4 or higher **
 *  Tested up to **6.8.5**
 *  PHP version ** 7.4 or higher **
 *  Languages
 * [English (Canada)](https://en-ca.wordpress.org/plugins/smart-custom-fields/),
   [English (UK)](https://en-gb.wordpress.org/plugins/smart-custom-fields/), [English (US)](https://wordpress.org/plugins/smart-custom-fields/),
   [Japanese](https://ja.wordpress.org/plugins/smart-custom-fields/), [Russian](https://ru.wordpress.org/plugins/smart-custom-fields/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/smart-custom-fields/), [Spanish (Spain)](https://es.wordpress.org/plugins/smart-custom-fields/),
   kaj [Swedish](https://sv.wordpress.org/plugins/smart-custom-fields/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/smart-custom-fields)
 * Tags
 * [custom](https://eo.wordpress.org/plugins/tags/custom/)[custom field](https://eo.wordpress.org/plugins/tags/custom-field/)
   [field](https://eo.wordpress.org/plugins/tags/field/)[meta](https://eo.wordpress.org/plugins/tags/meta/)
   [meta field](https://eo.wordpress.org/plugins/tags/meta-field/)
 *  [Altnivela rigardo](https://eo.wordpress.org/plugins/smart-custom-fields/advanced/)

## Pritaksoj

 4.9 out of 5 stars.

 *  [  19 5-star reviews     ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/smart-custom-fields/reviews/?filter=1)

[Aldoni mian recenzon](https://wordpress.org/support/plugin/smart-custom-fields/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/smart-custom-fields/reviews/)

## Kontribuantoj

 *   [ Takashi Kitajima ](https://profiles.wordpress.org/inc2734/)
 *   [ Toro_Unit (Hiroshi Urabe) ](https://profiles.wordpress.org/toro_unit/)
 *   [ Toshimichi Mimoto ](https://profiles.wordpress.org/mimosafa/)
 *   [ hide ](https://profiles.wordpress.org/hideokamoto/)
 *   [ Hisako Isaka ](https://profiles.wordpress.org/hisako-isaka/)
 *   [ Hidekazu Ishikawa ](https://profiles.wordpress.org/kurudrive/)
 *   [ hanamura ](https://profiles.wordpress.org/hanamura/)
 *   [ Justin Fletcher ](https://profiles.wordpress.org/justinticktock/)
 *   [ designhehe ](https://profiles.wordpress.org/designhehe/)
 *   [ Mayo Moriyama ](https://profiles.wordpress.org/mayukojpn/)
 *   [ yousan ](https://profiles.wordpress.org/hogetan/)
 *   [ Robssanches ](https://profiles.wordpress.org/robssanches/)
 *   [ Toshihiro Kanai ](https://profiles.wordpress.org/mirucon/)
 *   [ sysbird ](https://profiles.wordpress.org/sysbird/)
 *   [ Kengyu Nakamura ](https://profiles.wordpress.org/kengyu-nakamura/)
 *   [ fuyuan9 ](https://profiles.wordpress.org/fuyuan9/)
 *   [ まーちゅう ](https://profiles.wordpress.org/rocketmartue/)
 *   [ けい (Kei Nomura) ](https://profiles.wordpress.org/mypacecreator/)

## Helpo

Got something to say? Need help?

 [Vidi helpforumon](https://wordpress.org/support/plugin/smart-custom-fields/)

## Donaci

Ĉu vi volas subteni la pluevoluigon de tiu ĉi kromprogramo?

 [ Donaci al tiu ĉi kromprogramo ](http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40)