Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_action( 'admin_enqueue_scripts', 'theme_slug_admin_script' );
function theme_slug_admin_script( $hook_suffix ) {
// Check for post or page edit page.
if ( 'post.php' === $hook_suffix ) {
// Include the editor functions js.
wp_enqueue_script( 'theme_slug_editor-functions', get_theme_file_uri( 'js/backend-editor-functions.js' ), [], filemtime( get_theme_file_path( 'js/backend-editor-functions.js' ) ), true );
}
}
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.