I have an issue when I activate WP_DEBUG.
The issue apparently is on this line...
"$defaults[$value['id']] = $value['std'];"
Here's the code...
if ($value['type'] == 'multicheck'){
if (is_array($value['std'])){
foreach($value['std'] as $i=>$key){
$defaults[$value['id']][$key] = true;
}
} else {
$defaults[$value['id']][$value['std']] = true;
}
} else {
$defaults[$value['id']] = $value['std'];
}
Any ideas?
Michael Fields answers:
Please try the following instead:
if ( isset( $value['type'] ) && isset( $value['id'] ) && isset( $value['std'] ) && 'multicheck' == $value['type'] ) {
if ( is_array( $value['std'] ) ){
foreach( $value['std'] as $i => $key ){
$defaults[$value['id']][$key] = true;
}
}
else {
$defaults[$value['id']][$value['std']] = true;
}
}
else if ( isset( $value['id'] ) && isset( $value['std'] ) ) {
$defaults[$value['id']] = $value['std'];
}
Armand Morin comments:
That did it... worked perfectly.
I have a few other issues as well along the same lines.
Thanks Michael.
Utkarsh Kukreti answers:
You're missing the 'id' and 'std' keys of a multicheck field in the original options array you're passing to this. Could you paste the rest of the script?