Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::convert_status_to_query_value()protectedWC 1.0

Converts a status key into its equivalent comment_approved database column value.

Method of the class: ReviewsListTable{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->convert_status_to_query_value( $status ) : string;
$status(string) (required)
Status key from ReviewsListTable::get_status_filters().

ReviewsListTable::convert_status_to_query_value() code WC 9.4.2

protected function convert_status_to_query_value( string $status ) : string {
	// These keys exactly match the database column.
	if ( in_array( $status, [ 'spam', 'trash' ], true ) ) {
		return $status;
	}

	switch ( $status ) {
		case 'moderated':
			return '0';
		case 'approved':
			return '1';
		default:
			return 'all';
	}
}