Skip to content

Commit

Permalink
[bug] Theme Export: Use a better method to determine the theme name (#…
Browse files Browse the repository at this point in the history
…40829)

* Theme Export: Use a better method to determine the theme name

* Update lib/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php

Co-authored-by: Ari Stathopoulos <[email protected]>

Co-authored-by: Ari Stathopoulos <[email protected]>
  • Loading branch information
scruffian and aristath committed May 5, 2022
1 parent ac07469 commit ad2a96b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ public function export() {
return $filename;
}

$theme_name = wp_get_theme()->get( 'TextDomain' );
$stylesheet = get_stylesheet();
$stylesheet_directories = explode( '/', $stylesheet );
$theme_name = end( $stylesheet_directories );

header( 'Content-Type: application/zip' );
header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' );
header( 'Content-Length: ' . filesize( $filename ) );
Expand Down

0 comments on commit ad2a96b

Please sign in to comment.