* Author URI: https://aitattman.pages.dev * Plugin URI: https://github.com/AitAttman/aitattman-blocks * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: aitattman-blocks * Domain Path: /languages * */ /** * You can browse the source code and contribute to this plugin in GitHub: * https://github.com/AitAttman/aitattman-blocks */ if ( ! defined( 'ABSPATH' ) ) { /** * Exit if accessed directly. */ exit; } add_action( 'init', function () { /** * blocks folders names. * Blocks names can be also loaded from "build/blocks-manifest.php" when "--blocks-manifest" is used in * command: wp-scripts build --blocks-manifest */ $blocks = array( 'button', 'query', 'searchbox', 'sidepanel', 'slider', 'theme-controllers' ); /** * Register blocks from the manifest */ foreach ( $blocks as $block_name ) { $block_folder = plugin_dir_path( __FILE__ ) . 'build/' . $block_name; /** * do not override title and descriptions in second argument and * let WordPress load translations automatically. */ register_block_type_from_metadata( $block_folder ); } }, 10 );