Skip to content

Releases: designcontainer/block-json-parser

Fix: $theme_uri wrong value with WPML - Different languages in directories setting

Choose a tag to compare

@dariuszksiazek dariuszksiazek released this 13 Feb 16:16
41d16d2

Fixed issue with loading scripts and styles when using "Different languages in directories" setting in WPML.

v1.1.6

Choose a tag to compare

@aha113 aha113 released this 25 Aug 14:00

Fixed logic for loading js/css from child themes, if applicable.

v1.1.5

Choose a tag to compare

@aha113 aha113 released this 21 Aug 15:53
  • Fixes minor warning re: dynamic properties in PHP 8.2

Add child theme support

Choose a tag to compare

@aha113 aha113 released this 19 Jun 20:48
cbe22ed
  • New filter to identify that you want to load blocks from a child theme too. If so, the child theme block path is set as the primary path, and then the primary theme block folder is set as a secondary path. All blocks in these directories are loaded.

Fix php error when site does not include dc_person post type

Choose a tag to compare

@aha113 aha113 released this 03 Jun 11:26
09fe4c9
Merge pull request #3 from designcontainer/hotfix/php-error-dc-person

Fix for php error if dc_person not defined.

Moved init function to acf/init hook

Choose a tag to compare

@aha113 aha113 released this 03 Jan 13:46
66a10ec
  • This was done so that all custom post types initialised and could be used by the filters

v1.1.1

Choose a tag to compare

@RostiMelk RostiMelk released this 23 Dec 19:17

This release contains the following:

Utility function for caching static data, such as icons.
Usage example:

add_filter('block_json_parser_block_args', function ($args) {
	if (isset($args['icon']) && function_exists('material_icon')) :

                // This acts as the file name for the cached data
		$key = $args['icon'] . '.svg';

		if ($cached_icon = block_json_parser_cache_static($key)) {
			$args['icon'] =  $cached_icon;
		} else {
			$icon_data = material_icon($args['icon']);
                        // This will cache the content and return the data back
			$args['icon'] = block_json_parser_cache_static($key, $icon_data);
		}

	endif;

	return $args;
});

v1.1.0

Choose a tag to compare

@RostiMelk RostiMelk released this 23 Nov 13:14
1a8a7d1

This release contains the following:

  • Added filter for modifying default block args: block_json_parser_block_defaults
// Example of setting a default block category for blocks.
add_filter('block_json_parser_block_defaults', function($args) {
    $args['category'] = 'your_category';

    return $args;
});
  • Added filter for modifying block args: block_json_parser_block_args
// Example of handling block icons with a custom function.
add_filter('block_json_parser_block_args', function($args) {
    if ( isset( $args['icon'] ) && function_exists('material_icon') ) :
        $args['icon'] = material_icon($args['icon']);
    endif;

    return $args;
});
  • Removed references to internal function: material_icon().
  • Removed company block defaults in favour of filter.

v1.0.1

Choose a tag to compare

@RostiMelk RostiMelk released this 12 Nov 10:41

Fixed assets missing file extensions

Initial release

Choose a tag to compare

@RostiMelk RostiMelk released this 12 Nov 10:25
v1.0.0

initial commit