WP_Privacy_Requests_Table::get_sortable_columns() WordPress Method

This function defines which columns on the WP_Privacy_Requests_Table can be sorted by the user. By default, the table can be sorted by the following columns: 'request_id', 'email', 'status', 'type', 'created_timestamp', 'completed_timestamp'.

WP_Privacy_Requests_Table::get_sortable_columns() #

Get a list of sortable columns.


Return

(array) Default sortable columns.


Top ↑

Source

File: wp-admin/includes/class-wp-privacy-requests-table.php

	protected function get_sortable_columns() {
		/*
		 * The initial sorting is by 'Requested' (post_date) and descending.
		 * With initial sorting, the first click on 'Requested' should be ascending.
		 * With 'Requester' sorting active, the next click on 'Requested' should be descending.
		 */
		$desc_first = isset( $_GET['orderby'] );

		return array(
			'email'             => 'requester',
			'created_timestamp' => array( 'requested', $desc_first ),
		);
	}

Top ↑

Changelog

Changelog
VersionDescription
4.9.6Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.