From 47143bcffbeacdd3fa7cc54f6a881f521eefb210 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 15 Apr 2013 12:09:20 +0100 Subject: [PATCH] moved woocommerce_get_filename_from_url to core-functions as it is required in admin too. Closes #2949 --- readme.txt | 1 + woocommerce-core-functions.php | 11 +++++++++++ woocommerce-functions.php | 14 +------------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/readme.txt b/readme.txt index 1f159d6be7f..73e23c0f4f8 100644 --- a/readme.txt +++ b/readme.txt @@ -167,6 +167,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc = X = * Tweak - Support for the city field in shipping calc (filterable) +* Fix - moved woocommerce_get_filename_from_url to core-functions as it is required in admin too. = 2.0.7 - 12/04/2013 = * Feature - Option for GA _setDomainName. diff --git a/woocommerce-core-functions.php b/woocommerce-core-functions.php index 46739c6c70d..8f9ac1b8e0c 100644 --- a/woocommerce-core-functions.php +++ b/woocommerce-core-functions.php @@ -1288,6 +1288,17 @@ function woocommerce_downloadable_file_permission( $download_id, $product_id, $o if ( get_option('woocommerce_downloads_grant_access_after_payment') == 'yes' ) add_action( 'woocommerce_order_status_processing', 'woocommerce_downloadable_product_permissions' ); +/** + * Gets the filename part of a download URL + * + * @access public + * @param string $file_url + * @return string + */ +function woocommerce_get_filename_from_url( $file_url ) { + $parts = parse_url( $file_url ); + return basename( $parts['path'] ); +} /** * Order Status completed - This is a paying customer diff --git a/woocommerce-functions.php b/woocommerce-functions.php index 0a1e8547bbf..9c6685012de 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -1722,16 +1722,4 @@ function woocommerce_save_address() { } } -add_action( 'template_redirect', 'woocommerce_save_address' ); - -/** - * Gets the filename part of a download URL - * - * @access public - * @param string $file_url - * @return string - */ -function woocommerce_get_filename_from_url( $file_url ) { - $parts = parse_url( $file_url ); - return basename( $parts['path'] ); -} \ No newline at end of file +add_action( 'template_redirect', 'woocommerce_save_address' ); \ No newline at end of file