Skip to content

Commit

Permalink
Product Reviews Pro: Remove the file attachment field from the defaul…
Browse files Browse the repository at this point in the history
…t contribution fields
  • Loading branch information
Tamara Zuk committed Jan 3, 2019
1 parent c744e24 commit 8328697
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions woocommerce-product-reviews-pro/remove-file-attachment-field.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php // only copy this line if needed

/**
* Removes the file attachment field from the default contribution fields.
* Customers will still be able to post photos using the URL option.
*
* @param array $fields The default contribution fields.
* @return array The updated contribution fields.
*/
function sv_wc_product_reviews_pro_remove_attachment_file_field( $fields ) {

unset( $fields['attachment_file'] );

return $fields;
}
add_filter( 'wc_product_reviews_pro_default_fields', 'sv_wc_product_reviews_pro_remove_attachment_file_field' );

0 comments on commit 8328697

Please sign in to comment.