Skip to content

Commit

Permalink
Rename block theme activation nonce variable. (#52398)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc authored Jul 11, 2023
1 parent 2937e56 commit 1a8daf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.3/theme-previews.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function block_theme_activate_nonce() {
$nonce_handle = 'switch-theme_' . gutenberg_get_theme_preview_path();
?>
<script type="text/javascript">
window.BLOCK_THEME_ACTIVATE_NONCE = '<?php echo wp_create_nonce( $nonce_handle ); ?>';
window.WP_BLOCK_THEME_ACTIVATE_NONCE = '<?php echo wp_create_nonce( $nonce_handle ); ?>';
</script>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/utils/use-activate-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useActivateTheme() {
'themes.php?action=activate&stylesheet=' +
currentlyPreviewingTheme() +
'&_wpnonce=' +
window.BLOCK_THEME_ACTIVATE_NONCE;
window.WP_BLOCK_THEME_ACTIVATE_NONCE;
await window.fetch( activationURL );
const { wp_theme_preview: themePreview, ...params } =
location.params;
Expand Down

0 comments on commit 1a8daf5

Please sign in to comment.