moved woocommerce_get_filename_from_url to core-functions as it is required in admin too. Closes #2949

This commit is contained in:
Mike Jolley 2013-04-15 12:09:20 +01:00
parent 6924817c22
commit 47143bcffb
3 changed files with 13 additions and 13 deletions

View File

@ -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.

View File

@ -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

View File

@ -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'] );
}
add_action( 'template_redirect', 'woocommerce_save_address' );