WP_Privacy_Requests_Table::column_status() WordPress Method

The WP_Privacy_Requests_Table::column_status() method is used to display the status of a privacy request in the privacy requests list table. This method is called when the privacy requests list table is being generated. It is passed the status of the privacy request, and outputs a column with the status.

WP_Privacy_Requests_Table::column_status( WP_User_Request $item ) #

Status column.


Parameters

$item

(WP_User_Request)(Required)Item being shown.


Top ↑

Return

(string) Status column markup.


Top ↑

Source

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

	public function column_status( $item ) {
		$status        = get_post_status( $item->ID );
		$status_object = get_post_status_object( $status );

		if ( ! $status_object || empty( $status_object->label ) ) {
			return '-';
		}

		$timestamp = false;

		switch ( $status ) {
			case 'request-confirmed':
				$timestamp = $item->confirmed_timestamp;
				break;
			case 'request-completed':
				$timestamp = $item->completed_timestamp;
				break;
		}

		echo '<span class="status-label status-' . esc_attr( $status ) . '">';
		echo esc_html( $status_object->label );

		if ( $timestamp ) {
			echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
		}

		echo '</span>';
	}


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.