Documentation

Everything you need to get started with Blocksy Theme and Companion

Filters/Actions reference

Here we’ll outline a list of filters and actions that Blocksy calls at various points in the lifecycle of the website and the options UI.

Name: blocksy:general:sidebar-position
Type: Filter
Arguments: 1
Description: Change the sidebar position for a certain screen. Since 1.7.72
Possible values: none/left/right

add_filter('blocksy:general:sidebar-position', function ($current_value) {
  return 'none';
});

Gutenberg editor color palette

Name: blocksy:editor-color-palette
Type: Filter
Arguments: 1
Description: Add/remove color palettes into the Gutenberg editor. Intercepts the editor-color-palette call in the init phase. Since 1.7.65
Possible values: Array

add_filter('blocksy:editor-color-palette', function ($colors) {
  $colors[] = [
    'name' => __('Custom Color 1', 'blocksy'),
    'slug' => 'custom-color-1',
    'color' => '#a156b4',
  ];

  $colors[] = [
    'name' => __('Custom Color 2', 'blocksy'),
    'slug' => 'custom-color-2',
    'color' => '#a156b3',
  ];

  return $colors;
});

Social box add dynamic networks

Name: blocksy:social-box:dynamic-social-networks
Type: Filter
Arguments: 1
Description: Introduce additional social networks in Blocksy. They will show in Customizer → Visitor Engagement → Social Networks and in every place a social can be placed (Header, Footer, Widgets). id, name and icon fields are mandatory for each network — an error will be thrown if any of these is missing. icon must be a inline SVG, not an URL. Since 1.7.65
Possible values: [['id' => 'clubhouse', 'name' => 'Clubhouse', 'icon' => '<svg>...</svg>']]
Example:

add_filter('blocksy:social-box:dynamic-social-networks', function ($networks) {
	$networks[] = [
		'id' => 'clubhouse',
		'name' => __('Clubhouse', 'blocksy'),
		'icon' => ' <svg
          class="ct-icon"
		  width="20px"
		  height="20px"
		  viewBox="0 0 20 20">
			<path d="M20,10.1c0-5.5-4.5-10-10-10S0,4.5,0,10.1c0,5,3.7,9.1,8.4,9.9v-7H5.9v-2.9h2.5V7.9C8.4,5.4,9.9,4,12.2,4c1.1,0,2.2,0.2,2.2,0.2v2.5h-1.3c-1.2,0-1.6,0.8-1.6,1.6v1.9h2.8L13.9,13h-2.3v7C16.3,19.2,20,15.1,20,10.1z"/>
		</svg>',
	];

	return $networks;
});

Elementor columns alignment fix

Name: blocksy:integrations:elementor:fix_columns_alignment:default
Type: Filter
Arguments: 1
Description: Default value for the fix_columns_alignment option in Elementor.
Possible values: ''/'fix'

add_filter('blocksy:integrations:elementor:fix_columns_alignment:default', function ($default) {
  // '' | 'fix'
  return 'fix';
});

Change logo URL

Name: blocksy:header:logo:url
Type: Filter
Arguments: 1
Description: The URL for the logo item in the header. Possible value: URL as a string

add_filter('blocksy:header:logo:url', function ($home_page) {
  return 'https://my-custom-url.com';
});

Change site title wrapper tag

Name: blocksy:header:logo:wrapper-tag
Type: Filter
Arguments: 1
Description: The HTML tag for the logo heading in the header. Default: div. Since Blocksy 1.7.72

add_filter('blocksy:header:logo:wrapper-tag', function ($current_tag) {
  return 'span';
});

Allow transparency for headers on certain screens

Name: blocksy:header:transparent:current-screen-allowed
Type: Filter
Arguments: 3, result, $current_section, $transparent_result
Description: Allow/disallow transparency for headers on certain screens. Possible value: True/False. Since: Blocksy Companion 1.7.64

add_filter(
  'blocksy:header:transparent:current-screen-allowed',
  function ($has_transparent_header, $current_section, $transparent_result) {
    return false;
  },
  10, 3
);

Change cart URL

Name: blocksy:header:cart:url
Type: Filter
Arguments: 1
Description: The URL for the cart item in the header. Possible value: URL as a string. Since 1.7.69

add_filter('blocksy:header:cart:url', function ($url) {
  return 'https://custom-url.com';
});

Disable responsive menu on desktop

Name: blocksy:header:menu:has-responsive-desktop-menu
Type: Filter
Arguments: 1
Description: Whether to enable the More menu item in the menus on desktop
Default: true
Possible value: true/false

add_filter('blocksy:header:menu:has-responsive-desktop-menu', function ($menu) {
  return false;
});

Content Blocks: Hide hooks debugger

Name: blocksy:content-blocks:has-actions-debugger
Type: Filter
Arguments: 1
Description: Show/hide content blocks hooks debugger Since: 1.7.65
Default: true
Possible value: true/false

add_filter('blocksy:content-blocks:has-actions-debugger', function ($c) {
	return false;
});
Not the solution you are looking for?

Please check other articles or open a support ticket.