mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
Export: Add a filer, 'export_wp_filename'
to change the filename of the file to download when exporting.
Props MikeHansenMe, wonderboymusic. Fixes #29500. Built from https://develop.svn.wordpress.org/trunk@34327 git-svn-id: http://core.svn.wordpress.org/trunk@34291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0fd01b9057
commit
003edb6ea7
@ -43,8 +43,21 @@ function export_wp( $args = array() ) {
|
|||||||
do_action( 'export_wp', $args );
|
do_action( 'export_wp', $args );
|
||||||
|
|
||||||
$sitename = sanitize_key( get_bloginfo( 'name' ) );
|
$sitename = sanitize_key( get_bloginfo( 'name' ) );
|
||||||
if ( ! empty($sitename) ) $sitename .= '.';
|
if ( ! empty( $sitename ) ) {
|
||||||
$filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml';
|
$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-Description: File Transfer' );
|
||||||
header( 'Content-Disposition: attachment; filename=' . $filename );
|
header( 'Content-Disposition: attachment; filename=' . $filename );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34326';
|
$wp_version = '4.4-alpha-34327';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user