सामुग्रीवर जा
WordPress.org

मराठी

  • थीम
  • प्लगइन
  • बातम्या
  • मद्दत
  • वर्डप्रेस बद्दल
  • मराठी कार्यसंघ
  • संपर्क करा
  • वर्डप्रेस मिळवा
वर्डप्रेस मिळवा
WordPress.org

Plugin Directory

Easy Custom Fields

  • प्लगइन सादर करा
  • माझे आवडते
  • लॉग इन
  • प्लगइन सादर करा
  • माझे आवडते
  • लॉग इन

हे प्लगइन WordPress च्या शेवटच्या 3 महत्त्वाच्या प्रमुख पुनर्वितरणांच्या साथी चाचणी झालेले नाही. हे येथे वापरल्यास सामर्थ्य देणार नाही किंवा त्या आधारित असु शकते आणि WordPress च्या अधिक अद्ययावत आवृत्तींसह वापरताना संगतता समस्यांची शक्यता आहे.

Easy Custom Fields

Thorsten Ott कडून
डाउनलोड करा
  • तपशील
  • पुनरावलोकने
  • डेव्हलोपमेंट
समर्थन

वर्णन

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
  • Automattic

भाषांतर करा “Easy Custom Fields” तुमच्या भाषेत.

विकासातील आग्रह?

कोड ब्राउझ करा, SVN संग्रहालय तपासा, किंवा विकास लॉग च्या RSS द्वारे सदस्यता घ्या.

मेटा

  • आवृत्ती 0.6
  • शेवटचा अद्यतन 14 वर्षे पूर्वी
  • सक्रिय स्थापना 60+
  • वर्डप्रेस आवृत्ती 2.9.2 किंवा मोठा
  • परीक्षित केले आहे 3.3.2
  • भाषा
    English (US)
  • टॅग्ज:
    custom fieldspost metapost_meta
  • प्रगत दृश्य

मूल्यांकन

अजून कोणतीही पुनरावलोकने सबमिट केलेली नाहीत.

माझे समीक्षा जोडा

सर्व पुनरावलोकने पहा

योगदानकर्ते

  • Thorsten Ott
  • Automattic

समर्थन

काहीतरी सांगायचं आहे का? मदतीची आवश्यकता आहे का?

समर्थन फोरम पहा

  • बद्दल
  • बातम्या
  • होस्टिंग
  • गोपनीयता
  • शोकेस
  • थीम्स
  • प्लगिन्स
  • पॅटर्नस्
  • शिका
  • सहाय्य
  • विकासक
  • WordPress.tv ↗
  • सहभागी व्हा
  • कार्यक्रम
  • दान करा ↗
  • भविष्यासाठी पाच
  • WordPress.com ↗
  • मॅट ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

मराठी

  • आमच्या X (एक्स) (पूर्वीचे ट्विटर) खात्याला भेट द्या
  • आमच्या ब्लूस्की खात्याला भेट द्या.
  • Visit our Mastodon account
  • आमच्या थ्रेड्स खात्याला भेट द्या.
  • आमच्या फेसबुक पेजला भेट द्या
  • आमच्या इंस्टाग्राम खात्याला भेट द्या
  • आमच्या लिंक्डइन खात्याला भेट द्या
  • आमच्या टिकटॉक अकाउंटला भेट द्या.
  • आमच्या यूट्यूब चॅनेलला भेट द्या
  • आमच्या टंबलर खात्याला भेट द्या.
कोड कविता आहे