Created
April 17, 2024 21:34
-
-
Save bacoords/0d3d9a40bb8fad67e756fa004fc99e0e to your computer and use it in GitHub Desktop.
example enqueue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueue block editor assets. | |
* | |
* @return void | |
*/ | |
function enqueue_custom_block_editor_modifications() { | |
$asset_file = include PLUGIN_PATH . '/build/editor-modifications/index.asset.php'; | |
wp_enqueue_script( | |
'plugin-editor-modifications', | |
PLUGIN_URL . '/build/editor-modifications/index.js', | |
$asset_file['dependencies'], | |
$asset_file['version'], | |
true | |
); | |
wp_enqueue_style( | |
'plugin-editor-modifications', | |
PLUGIN_URL . '/build/editor-modifications/index.css', | |
array(), | |
$asset_file['version'] | |
); | |
} | |
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\enqueue_custom_block_editor_modifications' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment