• I keep getting the following warning when saving a post:

    Warning: Illegal string offset ‘type’ in /home/property/public_html/wp-content/themes/thesis_18/lib/admin/options_post.php on line 151

    Line 151 is this:

    // If we reach this point in the code, that means we're authenticated. Proceed with saving the new data
    		foreach ($post_options->meta_boxes as $meta_box) {
    			foreach ($meta_box['fields'] as $meta_field) {
    				$current_data = get_post_meta($post_id, $meta_field['name'], true);
    				$new_data = $_POST[$meta_field['name']];
    
    				<strong>if (($meta_field['type']['type'] == 'checkbox') && is_array($meta_field['type']['options'])) {</strong><em>
    					foreach ($meta_field['type']['options'] as $option_name => $option) {
    						if ((bool) $new_data[$option_name] != (bool) $option['default'])
    							$new_data[$option_name] = (bool) $new_data[$option_name];
    						elseif ((bool) $new_data[$option_name] == (bool) $option['default'])
    							unset($new_data[$option_name]);
    					}
    
    					if ($new_data)
    						update_post_meta($post_id, $meta_field['name'], $new_data);
    					else
    						delete_post_meta($post_id, $meta_field['name']);
    				}
    				else {
    					if ($current_data) {
    						if ($new_data == '')
    							delete_post_meta($post_id, $meta_field['name']);
    						elseif ($new_data == $meta_field['default'])
    							delete_post_meta($post_id, $meta_field['name']);
    						elseif ($new_data != $current_data)
    							update_post_meta($post_id, $meta_field['name'], $new_data);
    					}
    					elseif ($new_data != '')
    						add_post_meta($post_id, $meta_field['name'], $new_data, true);
    				}
    			}
    		}
    	}

    Does anyone know of a modification to this code to stop the warnings?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Thesis 1.8 and PHP 5.4’ is closed to new replies.