apply_filters( "manage_{$this->screen->id}_sortable_columns", array $sortable_columns )

Filters the list table sortable columns for a specific screen.


Description Description

The dynamic portion of the hook name, $this->screen->id, refers to the ID of the current screen, usually a string.


Parameters Parameters

$sortable_columns

(array) An array of sortable columns.


Top ↑

Source Source

File: wp-admin/includes/class-wp-list-table.php

View on Trac


Top ↑

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by websupporter

    As an example. When you see the table with the posts in the admin screen, you can sort the posts by title. If you wanted to remove the ability to sort by the title you could do the following:

    The screen ID for the posts overview page in the admin is edit-post, so the filter would be “manage_edit-post_sortable_columns”.

    add_filter( 'manage_edit-post_sortable_columns', 'slug_title_not_sortable' );
    function slug_title_not_sortable( $cols ) {
    	unset( $cols['title'] );
    	return $cols;
    }
    

You must log in before being able to contribute a note or feedback.