Plugin Directory

Changeset 538896


Ignore:
Timestamp:
05/02/2012 10:43:37 AM (14 years ago)
Author:
tott
Message:

make sure to preserve default values when no special conditions are set

File:
1 edited

Legend:

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

    r538823 r538896  
    430430            foreach( (array) $this->_used_fields as $box_id => $field_ids ) {
    431431                // bypass fields which are not used in this group
    432                 if ( !in_array( $_POST['post_type'], $this->_field_data[$box_id]['pages'] ) )
     432                $access = ( empty( $this->_field_data[$box_id]['pages'] ) ? array( 'post', 'page' ) : $this->_field_data[$box_id]['pages'] );
     433                if ( !in_array( $_POST['post_type'], $access ) )
    433434                    continue;
    434                    
     435                                   
    435436                if ( ( ! isset($_REQUEST[$this->_plugin_prefix . '_' . $box_id . '_nonce']) ) || ( ! wp_verify_nonce( $_REQUEST[$this->_plugin_prefix . '_' . $box_id . '_nonce'], $this->_plugin_prefix . '_' . $box_id . '_nonce' ) ) ) {
    436437                    return $post->ID;
Note: See TracChangeset for help on using the changeset viewer.