默认情况下,文件名在中定义/wp-admin/includes/export.php
:
$sitename = sanitize_key( get_bloginfo( \'name\' ) );
if ( ! empty( $sitename ) ) {
$sitename .= \'.\';
}
$date = gmdate( \'Y-m-d\' );
$wp_filename = $sitename . \'WordPress.\' . $date . \'.xml\';
您可以对其进行过滤:
$filename = apply_filters( \'export_wp_filename\', $wp_filename, $sitename, $date );
所以你可以制作一个插件并在那里添加一个过滤器:
add_filter(
\'export_wp_filename\',
function( $wp_filename, $sitename, $date )
{
// do something here, and then return a string
}, 10, 3
);