Last active
April 29, 2019 09:16
-
-
Save plugin-republic/48854d8510eb3e65f011b85aeab3450d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param $multiple '' | 'multiple' | |
* @param $product_id Product ID | |
* @param $id Field ID | |
*/ | |
// Enable multiple uploads for all file inputs | |
function prefix_filter_multiple( $multiple, $product_id, $id ) { | |
return 'multiple'; | |
} | |
add_filter( 'pewc_allow_multiple_file_upload', 'prefix_filter_multiple', 10, 3 ); | |
// Enable multiple file uploads by product ID | |
function prefix_filter_multiple_by_id( $multiple, $product_id, $id ) { | |
if( $product_id == 99 ) { | |
return 'multiple'; | |
} | |
return $multiple; | |
} | |
add_filter( 'pewc_allow_multiple_file_upload', 'prefix_filter_multiple_by_id', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment