Skip to content

Commit 3772d4d

Browse files
committed
Include snippets list in code_snippets/export/filename filter
1 parent 1140fe7 commit 3772d4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

php/class-export.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ private function do_headers( $format, $mime_type = 'text/plain' ) {
6464
}
6565

6666
$filename = "$title.code-snippets.$format";
67-
$filename = apply_filters( 'code_snippets/export/filename', $filename, $title );
67+
$filename = apply_filters( 'code_snippets/export/filename', $filename, $title, $this->snippets_list );
6868

6969
/* Set HTTP headers */
7070
header( 'Content-Disposition: attachment; filename=' . sanitize_file_name( $filename ) );
71-
header( "Content-Type: $mime_type; charset=" . get_bloginfo( 'charset' ) );
71+
header( sprintf( "Content-Type: %s; charset=%s", sanitize_mime_type( $mime_type ), get_bloginfo( 'charset' ) ) );
7272
}
7373

7474
/**

0 commit comments

Comments
 (0)