Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::set_review_type()protectedWC 1.0

Sets the $comment_type global based on the current request.

Метод класса: ReviewsListTable{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->set_review_type() : void;

Заметки

  • Global. Строка. $comment_type

Код ReviewsListTable::set_review_type() WC 8.7.0

protected function set_review_type() : void {
	global $comment_type;

	$review_type = sanitize_text_field( wp_unslash( $_REQUEST['review_type'] ?? 'all' ) );

	if ( 'all' !== $review_type && ! empty( $review_type ) ) {
		$comment_type = $review_type; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
	}
}