Skip to content

Instantly share code, notes, and snippets.

@florianbrinkmann
Created January 29, 2019 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianbrinkmann/bbc3429657f073a6ea4035504f32bcbb to your computer and use it in GitHub Desktop.
Save florianbrinkmann/bbc3429657f073a6ea4035504f32bcbb to your computer and use it in GitHub Desktop.
<?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