That area of all admin screens is where admin notices are displayed, so you could generate an admin notice.
Here's a suitable function and hook:
function wpse_233031_admin_notice() {
?>
<div class="notice notice-info">
<p>Your message here!</p>
</div>
<?php
}
function wpse_233031_hook_admin_notice() {
add_action( 'admin_notices', 'wpse_233031_admin_notice' );
}
add_action( 'load-upload.php', 'wpse_233031_hook_admin_notice' );
/* Edited out anonymous function callback,
which not only requires PHP 5.3 but is poor WP practice as
it prevents removal of the function from the hook
*/
Every admin page fires a unique hook of the form load-{unique-string-for-this-screen}
. For top level admin pages it takes the form load-{filename}
. On the load-upload.php
hook we hook into admin_notices
so that your notice only appears on this screen.
You should add a class of notice
to your div and one of notice-error
, notice-warning
, notice-success
, or notice-info
to get the standard WP styling. (If you add a class of is-dismissible
WP will supply you with a closing icon, but I believe you need to do the heavy lifting of dismissal and storing dismissed state yourself.)