Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::process_bulk_action()publicWC 1.0

Processes the bulk actions.

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

Хуков нет.

Возвращает

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

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

$ReviewsListTable = new ReviewsListTable();
$ReviewsListTable->process_bulk_action() : void;

Код ReviewsListTable::process_bulk_action() WC 9.3.3

public function process_bulk_action() : void {

	if ( ! $this->current_user_can_moderate_reviews ) {
		return;
	}

	if ( $this->current_action() ) {
		check_admin_referer( 'bulk-product-reviews' );

		$query_string = remove_query_arg( [ 'page', '_wpnonce' ], wp_unslash( ( $_SERVER['QUERY_STRING'] ?? '' ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

		// Replace current nonce with bulk-comments nonce.
		$comments_nonce = wp_create_nonce( 'bulk-comments' );
		$query_string   = add_query_arg( '_wpnonce', $comments_nonce, $query_string );

		// Redirect to edit-comments.php, which will handle processing the action for us.
		wp_safe_redirect( esc_url_raw( admin_url( 'edit-comments.php?' . $query_string ) ) );
		exit;
	} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {

		wp_safe_redirect( remove_query_arg( [ '_wp_http_referer', '_wpnonce' ] ) );
		exit;
	}
}