Make WordPress Core

Opened 9 years ago

Last modified 7 years ago

#35099 new enhancement

Make the filter links (Mine, Status, Author, Taxonomy, etc.) links in the posts list table filterable

Reported by: sebastianpisula's profile sebastian.pisula Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In ticket #35097 I wrote about filter edit page title. @SergeyBiryukov found a solution. But I want filter url in "All, Published, Trash" and others. I want add taxonomy info and see show posts from taxonomy in trash.

add_filter('edit_link', 'wp_edit_link_filter');

function wp_edit_link_filter($url){
        return add_query_arg(array('taonomy'=>'slug'), $url);
}

Attachments (1)

35099.patch (737 bytes) - added by sebastian.pisula 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
9 years ago

  • Description modified (diff)

#2 @DrewAPicture
7 years ago

  • Keywords has-patch added
  • Summary changed from New filter: `edit_link` to Make the edit URL in the posts list table filterable

#3 @DrewAPicture
7 years ago

  • Summary changed from Make the edit URL in the posts list table filterable to Make the filter links (Mine, Status, Author, Taxonomy, etc.) links in the posts list table filterable

#4 @DrewAPicture
7 years ago

So, I can see the value here, though I notice that the get_edit_link() method is kind of poorly named because it effectively builds the "filtering" links for the posts list table. Based on the name, you'd think it was creating the edit post links.

In terms of 35099.patch

  • We should probably use edit_link_url for the hook name, if only to provide slightly more context
  • Let's update the @since version
  • The DocBlock summary also needs a little work. Maybe something like "Filters URLs created for filtering the posts list table."
  • Finally, let's also pass the $class value to the hook
Note: See TracTickets for help on using tickets.