• chris howard

    (@chrishoward)


    I want to be able to display messages/info to users when they are on the post list screen.

    I’ve looked, and looked and looked, but can’t find any filters that provide a method to do that. The table column headers have a filter, but I just want something below the page title.

    Annotated screenshot

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Your options are limited. You could use the ‘views_edit-post’ filter. It is intended to add views besides the default All, Published, Sticky, etc. Each view is supposed to be a link that generates a table containing all the posts fitting the link text, but you could add any arbitrary HTML to this array of views. If your HTML includes a <BR> tag, you could cause your text to be on a different line. The only quirk is that all elements are separated by the pipe character | which you cannot prevent, so the first or last view would have an extra pipe with no related link if you use <BR>.

    Your filter callback is passed an array of view HTML links, add your HTML to the array. To get your element to be first in the array, reverse the passed array, add your element, then reverse it back to normal.

    Thread Starter chris howard

    (@chrishoward)

    Thanks, bcworkz. That achieved what I needed. Not sure if it’s a bit hacky, but did the job. I also didn’t need to do any of the extra tricks you said.

    https://www.screencast.com/t/s5NszR6zZA

    Thanks heaps.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a filter to the edit.php post list screen after the page title’ is closed to new replies.