Make WordPress Core


Ignore:
Timestamp:
09/19/2015 05:43:52 PM (9 years ago)
Author:
wonderboymusic
Message:

Export: Add a filer, 'export_wp_filename' to change the filename of the file to download when exporting.

Props MikeHansenMe, wonderboymusic.
Fixes #29500.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/export.php

    r34326 r34327  
    4444
    4545    $sitename = sanitize_key( get_bloginfo( 'name' ) );
    46     if ( ! empty($sitename) ) $sitename .= '.';
    47     $filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml';
     46    if ( ! empty( $sitename ) ) {
     47        $sitename .= '.';
     48    }
     49    $date = date( 'Y-m-d' );
     50    $wp_filename = $sitename . 'wordpress.' . $date . '.xml';
     51    /**
     52     * Filter the export filename.
     53     *
     54     * @since 4.4.0
     55     *
     56     * @param string $wp_filename The name of the file for download.
     57     * @param string $sitename    The site name.
     58     * @param string $date        Today's date, formatted.
     59     */
     60    $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
    4861
    4962    header( 'Content-Description: File Transfer' );
Note: See TracChangeset for help on using the changeset viewer.