I want to add some content (actually some scripts) to the wp-admin pages, so it will run on the media page, on posts page and all the other pages on the dashboard.
So I added this to the
functions.php
function test() {
// Your PHP goes here
echo 'hello';
}
add_action( 'wp_head', 'test' );
Try this
For script
function my_enqueue() {
// your script
}
add_action('admin_enqueue_scripts', 'my_enqueue');
FOR PHP
function add_php_data() {
// Do some stuff.
}
add_filter('admin_head', 'add_php_data');