This must be an easy question for those who are not new to WordPress (I am).
I want to add some HTML (a <script> tag, actually) to the page where you edit a post. I do NOT want to add HTML code to the post itself, rather I want to add some stuff somewhere in the code around the editor.
I think what I need is to hook into some action that fires when the editor page is created, but I’m not sure.
(I am guessing this is probably not a good practice but I’m trying to do a quick and dirty hack to save myself a lot of time in a project that is not going to be reused in the future. I want to use javascript to modify the editor page slightly when the DOM ready event fires.)
Also, can I do it from my theme’s functions.php file, or does it have to be a plugin?
Any help much appreciated.
Here is a simple function which you can put in you
functions.phpfile and add your script code, and it will only show up on the new/edit post page: