Plugin Directory

Changeset 527186


Ignore:
Timestamp:
04/04/2012 09:16:57 AM (14 years ago)
Author:
tott
Message:
  • Backward compatibility fixes
  • bugfix, use class parameter in group data not title
Location:
easy-custom-fields/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • easy-custom-fields/trunk/easy-custom-fields.php

    r527123 r527186  
    55Plugin URI: http://wordpress.org/extend/plugins/easy-custom-fields/
    66Description: A set of extendable classes for easy Custom Field Handling
    7 Version: 0.2
     7Version: 0.3
    88Author: Thorsten Ott
    99Author URI: http://automattic.com
     
    1313
    1414require_once( WP_PLUGIN_DIR . '/easy-custom-fields/easy-custom-fields.php' );
     15
    1516$field_data = array (
    1617    'testgroup' => array (              // unique group id
     
    2728
    2829require_once( WP_PLUGIN_DIR . '/easy-custom-fields/easy-custom-fields.php' );
     30
    2931$field_data = array (
    3032    'testgroup' => array (
     
    523525                foreach( (array) $group_data['fields'] as $field_id => $field ) {
    524526
     527                    $_fields[$field_id] = array( 'id' => $field_id, 'label' => null, 'hint' => null, 'class' => null, 'type' => null, 'validate' => null, 'error_msg' => null, 'input_class' => null );
     528                   
    525529                    // check field id
    526530                    if ( empty( $field_id ) ) {
     
    541545   
    542546                        // check hint
    543                         if ( !empty( $field_value ) && $field_name == 'hint' && !preg_match( "#^[a-zA-Z0-9_-\s:]+$#miU", $field_value ) ) {
    544                             $this->add_admin_notice( sprintf( __( "Field hint %s for group %s contains invalid chars use only [a-zA-Z0-9_-\s:]" ), $field_value, $group_id ) );
     547                        if ( !empty( $field_value ) && $field_name == 'hint' && !preg_match( "#^[a-zA-Z0-9_-\s:/\.]+$#miU", $field_value ) ) {
     548                            $this->add_admin_notice( sprintf( __( "Field hint %s for group %s contains invalid chars use only [a-zA-Z0-9_-\s:/\.]" ), $field_value, $group_id ) );
    545549                            continue;
    546550                        }
    547551   
    548552                        // check error_msg
    549                         if ( !empty( $field_value ) && $field_name == 'error_msg' && !preg_match( "#^[a-zA-Z0-9_-\s:]+$#miU", $field_value ) ) {
    550                             $this->add_admin_notice( sprintf( __( "Field error_msg %s for group %s contains invalid chars use only [a-zA-Z0-9_-\s:]" ), $field_value, $group_id ) );
     553                        if ( !empty( $field_value ) && $field_name == 'error_msg' && !preg_match( "#^[a-zA-Z0-9_-\s:/\.]+$#miU", $field_value ) ) {
     554                            $this->add_admin_notice( sprintf( __( "Field error_msg %s for group %s contains invalid chars use only [a-zA-Z0-9_-\s:/\.]" ), $field_value, $group_id ) );
    551555                            continue;
    552556                        }
     
    582586                $this->_field_data[$group_id] = array(
    583587                    'title'  => ( ! empty( $group_data['title'] ) ) ? $group_data['title'] : null,
    584                     'class'  => ( ! empty( $group_data['class'] ) ) ? $group_data['title'] : null,
     588                    'class'  => ( ! empty( $group_data['class'] ) ) ? $group_data['class'] : null,
    585589                    'fields' => $_fields,
    586590                    'pages'  => ( ! empty( $group_data['pages'] ) ) ? $group_data['pages'] : null,
  • easy-custom-fields/trunk/readme.txt

    r527123 r527186  
    33Tags: custom fields, post meta, post_meta, custom post fields
    44Requires at least: 2.9.2
    5 Tested up to: 3.3
     5Tested up to: 3.3.1
    66Stable tag: trunk
    77
Note: See TracChangeset for help on using the changeset viewer.