On a custom post type listing page the registered post statuses are listed as links above the post lists. I've a situation where custom registered post types are showing after 'trash' and I still want trash to be the last listed link.

What can I do? It's hard to find documentation on this because the of the complex terminology. Anyall help appreciated.

enter image description here

1 Answer 1


Turns out you can use this filter to alter the priority of the post_status links:


$views = apply_filters( "views_{$this->screen->id}", $views );

If your custom post type is 'inbound-email' then the applied filter will look like this:

    add_filter( 'views_edit-inbound-email' , 'function_to_filter_priority' );
     * rebuild priority of post status links
     * @param ARRAY $links
     * @return ARRAY $new_links
    function function_to_filter_priority( $links ) {
        $new_links['all'] = $links['all'];

        if (isset($links['draft'])) {
            $new_links['draft'] =  $links['draft'];
        if (isset($links['pending'])) {
            $new_links['pending'] =  $links['pending'];
        if (isset($links['sent'])) {
            $new_links['sent'] =  $links['sent'];
        if (isset($links['automated'])) {
            $new_links['automated'] =  $links['automated'];
        if (isset($links['trash'])) {
            $new_links['trash'] =  $links['trash'];

        return $new_links;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.