Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_view_url()protectedWC 1.0

Gets the base URL for a view, excluding the status (that should be appended).

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

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_view_url( $comment_type, $post_id ) : string;
$comment_type(строка) (обязательный)
Comment type filter.
$post_id(int) (обязательный)
Current post ID.

Код ReviewsListTable::get_view_url() WC 8.7.0

protected function get_view_url( string $comment_type, int $post_id ) : string {
	$link = Reviews::get_reviews_page_url();

	if ( ! empty( $comment_type ) && 'all' !== $comment_type ) {
		$link = add_query_arg( 'comment_type', urlencode( $comment_type ), $link );
	}
	if ( ! empty( $post_id ) ) {
		$link = add_query_arg( 'p', absint( $post_id ), $link );
	}

	return $link;
}