Title: Easy Custom Fields
Author: Thorsten Ott
Published: <strong>2010년 5월 2일</strong>
Last modified: 2012년 7월 11일

---

플러그인 검색

이 플러그인은 **최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다**. 워드프레스의
좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 
있을 수 있습니다.

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

# Easy Custom Fields

 작성자: [Thorsten Ott](https://profiles.wordpress.org/tott/)

[다운로드](https://downloads.wordpress.org/plugin/easy-custom-fields.zip)

 * [세부사항](https://ko.wordpress.org/plugins/easy-custom-fields/#description)
 * [평가](https://ko.wordpress.org/plugins/easy-custom-fields/#reviews)
 * [개발](https://ko.wordpress.org/plugins/easy-custom-fields/#developers)

 [지원](https://wordpress.org/support/plugin/easy-custom-fields/)

## 설명

Features:

 * simply generate post boxes with multiple fields / groups
 * easily validate/sanitize input and output data
 * easy access to field data via $easy_cf->field_id->get() or $easy_cf->field_id-
   >get( NULL, $raw=true );
 * get error messages for validation failures via admin notices
 * custom post type aware
 * extendable to your needs by extending Easy_CF_Field and Easy_CF_Validator classes(
   see advanced usage)

As this script is mainly meant as basis for developers it needs minor coding skills
to add this functionality
 to your theme.

In order to make use of this class simply initialize it from the functions.php file
of your theme as described below.

#### Simple Usage

    ```
    require_once( WP_PLUGIN_DIR . '/easy-custom-fields/easy-custom-fields.php' );
    $field_data = array (
        'testgroup' => array (              // unique group id
            'fields' => array(              // array "fields" with field definitions
                'field1'    => array(),     // globally unique field id
                'field2'    => array(),
                'field3'    => array(),
            ),
        ),
    );
    $easy_cf = new Easy_CF($field_data);
    ```

#### Advanced Usage

    ```
    require_once( WP_PLUGIN_DIR . '/easy-custom-fields/easy-custom-fields.php' );
    $field_data = array (
        'testgroup' => array (
            'fields' => array(
                'field1'    => array(),
                'field2'    => array(),
                'field3'    => array(),
            ),
        ),
        'advanced_testgroup' => array (                                     // unique group id
            'fields' => array(                                              // array "fields" with field definitions 
                'advanced_field'    => array(                               // globally unique field id
                    'label'         => 'Advanced Field Description',        // Field Label
                    'hint'          => 'Long Advanced Field description',   // A descriptive hint for the field
                    'type'          => 'textarea',                          // Custom Field Type (see Ref: field_type)
                    'class'         => 'aclass',                            // CSS Wrapper class for the field
                    'input_class'   => 'theEditor',                         // CSS class for the input field
                    'error_msg'     => 'The Advanced Field is wrong' ),     // Error message to show when validate fails
                    'validate'      => 'validatorname',                     // Custom Validator (see Ref: validator)
                'advanced_email' => array(
                    'label' => 'Email',
                    'hint' => 'Enter your email',
                    'validate' => 'email', )
            ),
            'title' => 'Product Description',   // Group Title
            'context' => 'advanced',            // context as in https://codex.wordpress.org/Function_Reference/add_meta_box
            'pages' => array( 'post', 'page' ), // pages as in https://codex.wordpress.org/Function_Reference/add_meta_box
        ),
    );

    if ( !class_exists( "Easy_CF_Validator_Email" ) ) {

        class Easy_CF_Validator_Email extends Easy_CF_Validator {
            public function get( $value='' ) {
                return esc_attr( $value );
            }

            public function set( $value='' ) {
                $value = esc_attr( trim( stripslashes( $value ) ) );
                return $value;
            }

            public function validate( $value='' ) {
                if ( empty( $value ) || is_email( $value ) ) 
                    return true;
                else
                    return false;
            }
        }
    }

    if ( !class_exists( "Easy_CF_Field_Textarea" ) ) {
        class Easy_CF_Field_Textarea extends Easy_CF_Field {
            public function print_form() {
                $class = ( empty( $this->_field_data['class'] ) ) ? $this->_field_data['id'] . '_class' :  $this->_field_data['class'];
                $input_class = ( empty( $this->_field_data['input_class'] ) ) ? $this->_field_data['id'] . '_input_class' :  $this->_field_data['input_class'];

                $id = ( empty( $this->_field_data['id'] ) ) ? $this->_field_data['id'] :  $this->_field_data['id'];
                $label = ( empty( $this->_field_data['label'] ) ) ? $this->_field_data['id'] :  $this->_field_data['label'];
                $value = $this->get();
                $hint = ( empty( $this->_field_data['hint'] ) ) ? '' :  '<p><em>' . $this->_field_data['hint'] . '</em></p>';

                $label_format =
                    '<div class="%s">'.
                    '<p><label for="%s"><strong>%s</strong></label></p>'.
                    '<p><textarea class="%s" style="width: 100%%;" type="text" name="%s">%s</textarea></p>'.
                    '%s'.
                    '</div>';
                printf( $label_format, $class, $id, $label, $input_class, $id, $value, $hint );
            }
        }
    }

    $easy_cf = new Easy_CF($field_data);
    ```

#### Note

If you’re not using auto_init then meta boxes need to be added individually using

add_meta_box( $group_id, $group_title, array( &$easy_cf, ‘meta_box_cb’ ), $page,
$group_context ); and the save methods need to be initialized after adding all meta
boxes using $easy_cf->add_save_method();

## 후기

이 플러그인에 대한 평가가 없습니다.

## 기여자 & 개발자

“Easy Custom Fields”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에
기여하였습니다.

기여자

 *   [ Thorsten Ott ](https://profiles.wordpress.org/tott/)
 *   [ Automattic ](https://profiles.wordpress.org/automattic/)

[자국어로 “Easy Custom Fields”(을)를 번역하세요.](https://translate.wordpress.org/projects/wp-plugins/easy-custom-fields)

### 개발에 관심이 있으십니까?

[코드 탐색하기](https://plugins.trac.wordpress.org/browser/easy-custom-fields/)는,
[SVN 저장소](https://plugins.svn.wordpress.org/easy-custom-fields/)를 확인하시거나,
[개발 기록](https://plugins.trac.wordpress.org/log/easy-custom-fields/)을 [RSS](https://plugins.trac.wordpress.org/log/easy-custom-fields/?limit=100&mode=stop_on_copy&format=rss)
로 구독하세요.

## 기초

 *  버전 **0.6**
 *  최근 업데이트: **14년 전**
 *  활성화된 설치 **60+**
 *  워드프레스 버전 ** 2.9.2 또는 그 이상 **
 *  다음까지 시험됨: **3.3.2**
 *  언어
 * [English (US)](https://wordpress.org/plugins/easy-custom-fields/)
 * 태그:
 * [custom fields](https://ko.wordpress.org/plugins/tags/custom-fields/)[post meta](https://ko.wordpress.org/plugins/tags/post-meta/)
   [post_meta](https://ko.wordpress.org/plugins/tags/post_meta/)
 *  [고급 보기](https://ko.wordpress.org/plugins/easy-custom-fields/advanced/)

## 평점

아직 제출된 리뷰가 없습니다.

[Your review](https://wordpress.org/support/plugin/easy-custom-fields/reviews/#new-post)

[모든  리뷰 보기](https://wordpress.org/support/plugin/easy-custom-fields/reviews/)

## 기여자

 *   [ Thorsten Ott ](https://profiles.wordpress.org/tott/)
 *   [ Automattic ](https://profiles.wordpress.org/automattic/)

## 지원

할 말 있으신가요? 도움이 필요하신가요?

 [지원 포럼 보기](https://wordpress.org/support/plugin/easy-custom-fields/)