Skip to content

Commit

Permalink
moved woocommerce_get_filename_from_url to core-functions as it is re…
Browse files Browse the repository at this point in the history
…quired in admin too. Closes #2949
  • Loading branch information
mikejolley committed Apr 15, 2013
1 parent 6924817 commit 47143bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions readme.txt
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions woocommerce-core-functions.php
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions woocommerce-functions.php
Expand Up @@ -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' );

0 comments on commit 47143bc

Please sign in to comment.