Fixing PHP (Adding custom fields to table )

I am working on this site, and I have created new Woocommerce custom fields, location, duration, time.

This plugin only allows ONE custom field. And I would like to have the title of the custom fields. Can anyone help me to do this?

Here is the code that does this,

/**********************************
* Product Custom Field
**********************************/
add_filter(‘dp_field_meta’,’dp_field_customField_cb’,10,2);
function dp_field_customField_cb($id,$col)
{
global $product,$dp_meta;
$custom=get_post_meta($id,$dp_meta[‘meta_key’],true);
switch ($dp_meta[‘type’])
{
case ‘text’ :
$output= html_entity_decode($custom);
break;
case ‘image’ :
$output='<img src=”‘.$custom.'” />’;
break;
case ‘shortcode’ :
$output= do_shortcode($custom);
break;
}
return $output;
}

Thanks,

Read more here:: Fixing PHP (Adding custom fields to table )

Leave a Reply

Your email address will not be published. Required fields are marked *