Reinstate [34327]. minus the unit test deletion.

git-svn-id: https://develop.svn.wordpress.org/trunk@34329 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-19 17:48:18 +00:00
parent 1e7832cc3b
commit 1b550d9fb2

View File

@ -43,8 +43,21 @@ function export_wp( $args = array() ) {
do_action( 'export_wp', $args );
$sitename = sanitize_key( get_bloginfo( 'name' ) );
if ( ! empty($sitename) ) $sitename .= '.';
$filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml';
if ( ! empty( $sitename ) ) {
$sitename .= '.';
}
$date = date( 'Y-m-d' );
$wp_filename = $sitename . 'wordpress.' . $date . '.xml';
/**
* Filter the export filename.
*
* @since 4.4.0
*
* @param string $wp_filename The name of the file for download.
* @param string $sitename The site name.
* @param string $date Today's date, formatted.
*/
$filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
header( 'Content-Description: File Transfer' );
header( 'Content-Disposition: attachment; filename=' . $filename );