Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 31.579.043 Times

Easy Custom Fields 0.1

  Date Added: April 13, 2013  |  Visits: 281

Easy Custom Fields

Report Broken Link
Printer Friendly Version

Product Homepage
Download (19 downloads)

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 Usagerequire_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 Usagerequire_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 'pages' => array( 'post', 'page' ), // pages as in ),);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'] ) ) ? '' : '' . $this->_field_data['hint'] . ''; $label_format = ''. '%s'. '%s'. '%s'. ''; printf( $label_format, $class, $id, $label, $input_class, $id, $value, $hint ); } }}$easy_cf = new Easy_CF($field_data);NoteIf 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();

Requirements: No special requirements
Platforms: PHP
Keyword: Array Boxes Class Definitions Empty Field Fields Function Globally Public Quotfieldsquot Return Testgroup Thisgt Field Data Unique Value3d039039
Users rating: 0/10

License: Freeware Size: 30.72 KB
Modules  -  Views Crosstab 6.x-1.0-alpha1
This views style plugin lets you display views results as a crosstab - grouping rows by one field, columns by another, and using an aggregate function (count, sum etc) of a third field for the table data.For example, this module will take a table...
10 KB  
Libraries  -  Class::Struct::FIELDS 1.1
Class::Struct::FIELDS module combine Class::Struct, base and fields. SYNOPSIS (This page documents Class::Struct::FIELDS v.1.1.) use Class::Struct::FIELDS; # declare struct, based on fields, explicit class name: struct (CLASS_NAME => {...
18.43 KB  
Programming  -  dolmen.forms.base 1.0 Beta 2
dolmen.forms.base is a package in charge of providing basic functionalities to work with zeam.form Forms. From the form to the field dolmen.forms.base provides few functions dedicated to the task of applying dict datas to object...
10.24 KB  
Modules  -  Dependent fields 5.x-1.4-beta 1.0
The module allows nested fields dependencies, which means that a field can depend on the value of a certain field that also depends on another field.It also you to determine whether the dependent "child field" will be attached right after its...
Miscellaneous  -  Rapid Form Builder 0.1
There is one class that can generate HTML and Javascript to display form fields and have them validated immediately after the field values are changed. A different class is used to validate and process the submitted forms in order to modify MySQL...
Programming  -  StyledTextToHTML 1.1
This project extends the StyledText class to add a new function, .ToHTML(). If you call it on a StyledText, it will return the HTML for that styled text. It only works in RB 5.5 and higher.
10.24 KB  
Programming  -  StyledTextToRTF 1.0
This project extends the StyledText class to add a new function, .ToRTF(). If you call it on a StyledText, it will return the RTF for that styled text. It only works in RB 5.5 and higher.
10.24 KB  
Utilities  - 1.10a generates Python data structures (for example, class definitions) from an XML Schema document. These data structures represent the elements in an XML document described by the XML Schema. It also generates parsers that load an XML...
112.64 KB  
Libraries  -  Generic Java Algebra Library 0.0.1
Generic Java Algebra Library is a collection that includes generic class definitions in GJ/Generic Java/JSR-014. It helps to outline algebraic structures such as Monoids, SemiGroups, Groups, Rings, Fields and various Domains. It is very useful for...
Modules  -  Preset Widget Options 5.x-1.x-de
Enables custom select options and accompanying display widgets for CCK text fields. Preset Widget Options gives developers a lot of control over the handling and display of fields without having to declare a whole new field type.This module should...
10 KB  
Scripts  -  Free Ecommerce website creator 1.2
Free Ecommerce website creator is a free PHP shop creating script. This allows you to put a online shop on your own website. Create your own free ecommerce website for Your Business. Create an online shop using easyGUI online shop creator. The...
1.44 KB  
Scripts  -  MochiGames PHP Script ZDR 1.00
MochiGames PHP Script ZDR is web site, ready for use, for flash games. These flash games are downloaded automatically by "MochiGames PHP Script ZDR" from MochiGames media. The use of the games is free, you can use your own Mochi Publisher ID and...
368.54 KB  
Scripts  -  Php Chat 2.0
Add a free php site, single sign-on and multiple skins, 100% free 1. Server Modes: The chat server has paid mode and free mode. If the free chat mode, a free chat room will be assigned to your website with your domain as the room name. 2....
938.87 KB  
Scripts  -  Nibbleblog 3.0.1
Nibbleblog it's a powerful engine for creation and manipulation of BLOG's completely free. Very simple to install and configure (Only 1 step). The database used is based on XML files and this way it is not necessary to use MySQL or similar DBMS....
371.09 KB  
Scripts  -  PHP File Manager | CloudOsys 2.9b8
CloudOsys is a PHP file manager, a tool that allows your visitors upload files such as media content directly to your website. Your visitors will upload files directly to your website, where they can share and comment on them. Through cloud...
1.41 MB  
Networking  -  Shortcode Autolink 0.1
Lets you create links automatically on the basis of internal research results, and everything through Shortcode !Installation : 1. Upload the plugin folder to your /wp-content/plugins/ folder. 2. Go to the Plugins page and activate the plugin. 3....
10 KB  
Networking  -  Pixel Sitemap 1.0.0
Pixel Sitemap Plugin allows with the use of widget to display in sidebar links on the posts in compact way, namely as a rows of 1 pixel pictures.The main features are: * Support cache for links * Display links in random order or by date * Easy...
10 KB  
Networking  -  Contexture Page Security 0.7.1
Contexture Page Security adds some much-needed "page security" to WordPress, allowing admins to limit or restrict access to individual pages or entire sections of their website. To do this, admins create "groups" of users that can be added to...
10 KB  
Networking  -  Vertical scroll recent post 8.0
This will scroll the recent post title in site side bar or any desired template location.In version 4.0 three new option added. 1. Categories selection. 2. select display Orderbys. 3. select display orderFeature * User can see the newest post at...
10 KB  
Networking  -  Wp-o-Matic-Authors 1.0
"Wp-o-matic-Authors" is an add-on to Wp-o-Matic. It automatically creates a new author for each campaign (even if already fetched). Then, each post imported by Wp-o-Matic will have as author the name given by this plugin instead of a name already...
10 KB