Dynamic content

ska-blocks -> Options -> Dynamic content option allows you to set up commonly used data so that it can be kept all in once place. You can set an e-mail, phone, social media addresses or other custom data:

Options under ska-blocks -> Options -> Dynamic content

The values can then be referred to on other pages using [ska-*] shortcodes or, for links, using the Dynamic links interface:

The dynamic links interface will appear on the block toolbar when using Element or Text blocks with the HTML tag name <a>.

Not to be confused with another “link” item on the toolbar that is used for adding a link to Rich Text (as in it will not add a link to the block’s root element, but will wrap some part of the text inside the block in an additional <a> element which is not valid HTML):

Dynamic content options

All the options have additional settings:

Widget

Enabling the “Widget” setting of a dynamic option will display it on the WordPress admin dashboard so that it can be conveniently edited like a global custom field.

Dynamic content widget on the WordPress admin dashboard

The widget will be visible to all users with the unfiltered_html capability.

Type

Changing the type of a dynamic shortcode allows to control which HTML input element is used for it in the widget.

Textarea

The content type option can be changed to “Textarea” for a bigger input in the widget.

Toggle

When using the “Toggle” type the value is considered “On” when there is any text and “Off” when there is no text.

In the widget only a checkbox is shown.

This can be used in combination with the Condition block and some code to provide a simple toggle for some content.

Custom conditional using dynamic shortcode valuePHP
function ska_condition_campaign_active() {
	return ska_blocks_field('campaign-active');
}

Date

Renders an input[type=date] in the Dynamic content widget, providing a value such as 2026-01-23.

Datetime

Renders an input[type=datetime-local] in the Dynamic content widget, providing a value such as 2026-01-23T13:59.

Retrieval

The values of dynamic shortcodes can be retrieved from the plugin options:

Retrieve all dynamic shortcodes from ska-blocks optionsPHP
/**
 * array(2) {
 *  ["email"] => string(20) "changeme@example.com"
 *  ["phone"] => string(17) "+1 (555) 123-4567"
 * }
 */
$shortcodes = ska_blocks()->get('options')->get('dynamicShortcodes');

Alternatively, a helper function is available to retrieve the value of a specific shortcode:

Retrieve all dynamic shortcodes from ska-blocks optionsPHP
/** @var string `changeme@example.com` */
$email = ska_blocks_field('email');

/** @var false */
$not_found = ska_blocks_field('does-not-exist');

/** @var bool */
$bool = ska_blocks_field('type-toggle');