Skip to content

Instantly share code, notes, and snippets.

View Taigistal's full-sized avatar

Silas Köhler Taigistal

View GitHub Profile
/**
* Has block function which searches as well in reusable blocks.
*
* Extends functionality of core's has_block (https://developer.wordpress.org/reference/functions/has_block/)
*
* @param mixed $block_name Full Block type to look for.
* @return bool
*/
function enhanced_has_block($searched_block_name)
@Taigistal
Taigistal / webpack.config.js
Last active May 14, 2024 06:59
Example webpack config override when using --experimental-modules flag with wp-scripts
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const { merge } = require( 'webpack-merge' );
// get default configs
const [ scriptConfig, moduleConfig ] = defaultConfig;
/**
* Override script config
* the script config is the default config, which is used with or without the --experimental-modules flag