wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_block_theme_activate_nonce is private and should not be used in themes or plugins directly.
wp_block_theme_activate_nonce › WordPress Function
Since6.3.0
Deprecatedn/a
› wp_block_theme_activate_nonce ( No parameters )
Access: |
|
See: | |
Defined at: |
|
Codex: |
Set a JavaScript constant for theme activation.
Sets the JavaScript global WP_BLOCK_THEME_ACTIVATE_NONCE containing the nonce required to activate a theme. For use within the site editor.Source
function wp_block_theme_activate_nonce() { $nonce_handle = 'switch-theme_' . wp_get_theme_preview_path(); ?> <script type="text/javascript"> window.WP_BLOCK_THEME_ACTIVATE_NONCE = <?php echo wp_json_encode( wp_create_nonce( $nonce_handle ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>; </script> <?php }