WC_Product_CSV_Importer::parse_download_file_field
Parse download file urls, we should allow shortcodes here.
Allow shortcodes if present, otherwise esc_url the value.
Method of the class: WC_Product_CSV_Importer{}
No Hooks.
Returns
String.
Usage
$WC_Product_CSV_Importer = new WC_Product_CSV_Importer(); $WC_Product_CSV_Importer->parse_download_file_field( $value );
- $value(string) (required)
- Field value.
WC_Product_CSV_Importer::parse_download_file_field() WC Product CSV Importer::parse download file field code WC 10.6.2
public function parse_download_file_field( $value ) {
// Absolute file paths.
if ( 0 === strpos( $value, 'http' ) ) {
return esc_url_raw( $value );
}
// Relative and shortcode paths.
return wc_clean( $value );
}