Skip to content

Instantly share code, notes, and snippets.

@Shininglow

Shininglow/extra.php

Created Aug 13, 2019
Embed
What would you like to do?
For a new Gutenberg block
<?php
/**
*Plugin name: Extra
*Author: My name
*Version: 1.0.0
*/
function loadMyBlockFiles() {
wp_enqueue_script(
'my-test-text',
plugin_dir_url(__FILE__). 'extra.js',
array('wp-blocks', 'wp-i18n', 'wp-editor'),
true
);
}
add_action('enqueue_block_editor_assets', 'loadMyBlockFiles');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.