WP_Privacy_Requests_Table
- Since
- 4.9.6
- Source
wp-admin/includes/class-wp-privacy-requests-table.php:10
List Table API: WP_Privacy_Requests_Table class
Compatibility
- WordPress
- since 4.9.6
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 1
Every hook that fires from inside WP_Privacy_Requests_Table, in the order it appears in the class, grouped by the method that fires it.
Properties · 2
$request_typestringprotected- Action name for the requests this table will work with. Classes which inherit from WP_Privacy_Requests_Table should define this.
$post_typestringprotected- Post type to be used.
Methods · 18
- get_columns()Gets columns to show in the list table.
- get_admin_url()Normalizes the admin URL to the current page (by request_type).
- get_sortable_columns()Gets a list of sortable columns.
- get_default_primary_column_name()Returns the default primary column.
- get_request_counts()Counts the number of requests for each status.
- get_views()Gets an associative array ( id => link ) with the list of views available on this table.
- get_bulk_actions()Gets bulk actions.
- process_bulk_action()Process bulk actions.
- prepare_items()Prepares items to output.
- column_cb()Returns the markup for the Checkbox column.
- column_status()Status column.
- get_timestamp_as_date()Converts a timestamp for display.
- column_default()Handles the default column.
- column_created_timestamp()Returns the markup for the Created timestamp column. Overridden by children.
- column_email()Actions column. Overridden by children.
- column_next_steps()Returns the markup for the next steps column. Overridden by children.
- single_row()Generates content for a single row of the table,
- embed_scripts()Embeds scripts used to perform actions. Overridden by children.
Source code
abstract class WP_Privacy_Requests_Table extends WP_List_Table { /** * Action name for the requests this table will work with. Classes * which inherit from WP_Privacy_Requests_Table should define this. * * Example: 'export_personal_data'. * * @since 4.9.6 * * @var string $request_type Name of action. */ protected $request_type = 'INVALID'; /** * Post type to be used. * * @since 4.9.6 * * @var string $post_type The post type. */ protected $post_type = 'INVALID'; /** * Gets columns to show in the list table. * * @since 4.9.6 * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { $columns = array( 'cb' => '<input type="checkbox" />', 'email' => __( 'Requester' ), 'status' => __( 'Status' ), 'created_timestamp' => __( 'Requested' ), 'next_steps' => __( 'Next steps' ), ); return $columns; } /** * Normalizes the admin URL to the current page (by request_type). * * @since 5.3.0 * * @return string URL to the current admin page. */ protected function get_admin_url() { $pagenow = str_replace( '_', '-', $this->request_type ); if ( 'remove-personal-data' === $pagenow ) { $pagenow = 'erase-personal-data'; } return admin_url( $pagenow . '.php' ); } /** * Gets a list of sortable columns. * * @since 4.9.6 * * @return array Default sortable columns. */ 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 ), ); } /**Changelog
Introduced in 4.9.6. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-admin/includes/class-wp-privacy-requests-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.