Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save interplaydesign/b9264de5160b364e19d2f27cf7f08dfc to your computer and use it in GitHub Desktop.

Select an option

Save interplaydesign/b9264de5160b364e19d2f27cf7f08dfc to your computer and use it in GitHub Desktop.
Block Customization Plugin 1
<?php
/**
* Plugin Name: Core Block Customizations
* This file is in your plugin folder and the folder and this file must have the same name
**/
function icbc_enqueue() {
wp_enqueue_script(
'icbc-script',
plugins_url( 'js/core-block-customizations.js', __FILE__ ),
array( 'wp-blocks' )
);
}
add_action( 'enqueue_block_editor_assets', 'icbc_enqueue' );
function icbc_stylesheet() {
wp_enqueue_style( 'icbc-script',
plugins_url( 'css/core-block-customizations.css', __FILE__ ) );
}
add_action( 'enqueue_block_assets', 'icbc_stylesheet' );
function icbc_public_javascript_enqueue(){
wp_enqueue_script(
'icbc-public-script',
plugins_url( 'js/core-block-customizations-public.js', __FILE__ ),
array()
);
}
add_action( 'wp_enqueue_scripts', 'icbc_public_javascript_enqueue' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment