BUG in 3.3.2 admin - won't display custom fields in add/edit ad
I think there is a bug in classipress/includes/admin/admin.php
In function cp_edit_ad_fields () it checks to see whether the custom fields associated with the post should be displayed in the Ad Meta Fields metabox, and it should do this by checking if the field being processed is attached to the form layout for the category in question.
This is the check it does:
// we only want key values that match the field_name in the custom field table .
if ( in_array($result->field_name, $custom_field_keys) || $result->field_type == 'checkbox' ) :
Currently, I only see custom fields if they ARE a checkbox....any other custom fields are not being shown in the Ad Meta Fields metabox. The first part of the if statement is never matching anything....so only if it's a checkbox am I getting a custom field displayed.
I have put some debug statements in this field, and it is looking for field_names such as cp_price in an array that contains only the following:
0 => _yoast_wpseo_linkdex
1 => _edit_last
2 => _edit_lock
3 => cp_sys_expire_date
4 => cp_sys_ad_conf_id
5 => cp_sys_userIP
6 => cp_daily_count
7 => cp_total_count
8 => cp_sys_ad_duration
9 => cp_sys_total_ad_cost
So obviously the if condition is not met and the fields aren't displayed....
Obviously, the array that is being checked is missing a whole heap of items.
I see from the code that this area has been totally re-written in the new version of classipress....previously there was no /includes/admin/admin.php and the meta box was displayed by a totally different file called /includes/admin/write-panel.php.
Any hints on where to look to track down why the check fails....? Quick fix urgently needed on this, as it means the back end is not useable for editing or adding listings....