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.
Return
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 7.7.0
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 ); }