The code block is an alternative for the WordPress code block with the addition of syntax highlighting, indenting and copy function.
The Code block uses the “Code block” preset for its’ appearance by default.
Basic code block
<p class="lead">The code block is an alternative for the WordPress code block with the addition of syntax highlighting, indenting and copy function.</p>
Code block with a header
Code block can have a header that can contain a short description of the given code.
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3
}
Copy button
Code block can include a button for copying its’ contents. The button requires Alpine.js so if you’re not using ska-theme you’ll need to provide your own.
/**
* Disable auto-update email notifications.
*/
add_filter('auto_core_update_send_email', '__return_false');
add_filter('auto_plugin_update_send_email', '__return_false');
add_filter('auto_theme_update_send_email', '__return_false');
PHP