WordPress plugin intelligence profile

Easy Custom Fields

This is a set of extendable classes to allow easy handling of custom post fields.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 3.3
Current version0.6
WordPress coverageTested up to WordPress 3.3
Minimum stackWP 2.9.2 · PHP —
Directory statusactive
Last directory update11 Jul 201214y ago
Active installations20Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Easy Custom Fields version 0.6 as active, updated 14y ago and tested up to WordPress 3.3.

Overview

About this plugin

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.

php file of your theme as described below.

Simple Usage

require_once( WP_PLUGIN_DIR. 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. org/Function_Reference/add_meta_box ), );

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; } } }

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();

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • custom fields
  • custom post fields
  • post meta
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 3.3

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 3.3.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to3.3
Minimum requirementsWordPress 2.9.2 · PHP not listed
Update activity11 Jul 201214y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.