diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index d5b3899cdd0..4c8b66878f0 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -177,7 +177,7 @@ class WC_Product { * @return int */ public function get_stock_quantity() { - return $this->managing_stock() ? wc_stock_amount( $this->stock ) : ''; + return apply_filters( 'woocommerce_get_stock_quantity', $this->managing_stock() ? wc_stock_amount( $this->stock ) : '', $this ); } /** diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php index db0a0d3c0ea..8ac4e0ce1ff 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php @@ -1154,7 +1154,7 @@ class WC_Meta_Box_Product_Data { if ( isset( $_POST['_wc_file_urls'] ) ) { $file_names = isset( $_POST['_wc_file_names'] ) ? $_POST['_wc_file_names'] : array(); - $file_urls = isset( $_POST['_wc_file_urls'] ) ? array_map( 'trim', $_POST['_wc_file_urls'] ) : array(); + $file_urls = isset( $_POST['_wc_file_urls'] ) ? wp_unslash( array_map( 'trim', $_POST['_wc_file_urls'] ) ) : array(); $file_url_size = sizeof( $file_urls ); $allowed_file_types = apply_filters( 'woocommerce_downloadable_file_allowed_mime_types', get_allowed_mime_types() );