WordPress: How to hook into edit.php

I would like to add an html tag just below the admin posts list in the edit.php file.
So far I succeeded in doing it by using the “admin_init” action hook but then, the html tag also appears in other pages (like post-new.php for instance) which is not what I want.
How can I only target the edit.php file?
Thank you

Related posts

Leave a Reply

1 comment

  1. If your code is putting things on the page where you want it, but on too many pages, then try this:

    if (basename($_SERVER['SCRIPT_NAME']) == 'edit.php') {
        // your code here
    }
    

    That will restrict it to just the edit.php script.

    You might also need to test for certain values of the query parameters ‘action’ and ‘action2’, by checking $_REQUEST['action'] and $_REQUEST['action2'].