Hi. How can we help?

How to remove custom fields from product section

If you want to remove custom fields for ALL USERS, please copy and past this code at the end of functions.php file of your theme:

add_filter( 'yith_wcfm_show_custom_fields_on_cpt', 'yith_wcfm_show_custom_fields_on_cpt', 10, 2 );

if( ! function_exists( 'yith_wcfm_show_custom_fields_on_cpt' ) ){
function yith_wcfm_show_custom_fields_on_cpt( $show, $section ){
return 'product' == $section ? false : $show;
}
}

If you want to remove the section but ONLY FOR VENDORS, use this code instead:

add_filter( 'yith_wcfm_show_custom_fields_on_cpt', 'yith_wcfm_show_custom_fields_on_cpt', 10, 2 );

if( ! function_exists( 'yith_wcfm_show_custom_fields_on_cpt' ) ){
function yith_wcfm_show_custom_fields_on_cpt( $show, $section ){
if( function_exists( 'yith_get_vendor' ) && 'product' === $section ){
$vendor = yith_get_vendor( 'current', 'user' );
if( $vendor->is_valid() ){
$show = false;
}
}
return $show;
}
}

The same code can be used for the orders section by simply changing the string 'product' to 'order'

Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >