Skip to content

Commit

Permalink
Include snippets list in code_snippets/export/filename filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed Jun 2, 2022
1 parent 1140fe7 commit 3772d4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/class-export.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ private function do_headers( $format, $mime_type = 'text/plain' ) {
}

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

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

/**
Expand Down

0 comments on commit 3772d4d

Please sign in to comment.