Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Remoce fields from "add product" section
- This topic has 1 reply, 2 voices, and was last updated 4 years, 11 months ago by Sushobhan.
Viewing 1 reply thread
- AuthorPosts
- February 9, 2020 at 11:23 am #106265andreasenglowskiParticipant
Hi,
i am looking to remove some fields from the vendor -> add product window. Did attach screenshot for you. Is that possible?Thanks in advance,
AndiAttachments:
You must be logged in to view attached files. - February 10, 2020 at 3:37 pm #106458SushobhanKeymaster
Hi,
Kindly use the following snippet for this-add_filter( 'wcfm_product_manage_fields_general', function( $general_fields, $product_id, $product_type ) { if( isset( $general_fields['pro_title'] ) ) { $general_fields['pro_title']['attributes'] = array( 'maxlength' => 10 ); //number of characters permitted. Change it as per your need. } return $general_fields; }, 50, 3 ); add_filter( 'wcfm_product_manage_fields_pricing', function( $pricing_fields, $product_id, $product_type ) { if ( isset( $pricing_fields['sale_price'] ) ) { unset( $pricing_fields['sale_price'] ); } return $pricing_fields; }, 50, 3 ); add_filter( 'wcfm_product_manage_fields_content', function( $content_fields, $product_id, $product_type ) { if ( isset( $content_fields['excerpt'] ) ) { $content_fields['excerpt']['media_buttons'] = false; } return $content_fields; }, 50, 3 );
Here I use maxlength property for the title field. You can learn more about this here – https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength
Thanks!
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.