Proper way to add a button to the top menu of the media library?
So, this is the only way I’ve found so far and it’s ugly, however WordPress offers no means of modifying this through filters that I can find in core. I present, the hacky “do-it-through-Javascript” method: add_action( ‘load-upload.php’, function(){ $js = <<<JAVASCRIPT jQuery(document).ready(function($){ setTimeout(function() { $(‘.wp-filter .button:last’ ).after($(‘<button class=”button”>Hi</button>’)); }, 1000); }); JAVASCRIPT; add_filter( ‘admin_footer’, function() … Read more