Code block

The code block is an alternative for the WordPress code block with the addition of syntax highlighting, indenting and copy function.

When using ska-theme the Code block uses the “Code block” preset for its’ appearance by default. When not using ska-theme the Code block will receive the same appearance as Tailwind classes and ideally you should create your own preset from that and create a variation of the block with that preset applied so that all the instances of the Code block that you use are able to be styled from a single place.

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.

Basic WordPress theme.jsonJSON
{
	"$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