# wp-parsely/3.23.3/src/rest-api/stats/class-stats-controller.php

Parse.ly, version 3.23.3. 49 lines.

- Page: https://pluginprobe.com/plugins/wp-parsely/3.23.3/code/src/rest-api/stats/class-stats-controller.php
- Raw: https://pluginprobe.com/plugins/wp-parsely/3.23.3/raw/src/rest-api/stats/class-stats-controller.php
- Modified: 2024-11-12T09:05:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-parsely/3.23.3/code/src/rest-api/stats/class-stats-controller.php#L10-L20`.

```php
<?php
/**
 * Stats API Controller
 *
 * @package Parsely
 * @since   3.17.0
 */

declare(strict_types=1);

namespace Parsely\REST_API\Stats;

use Parsely\REST_API\REST_API_Controller;

/**
 * The Stats API Controller.
 *
 * Used to define the namespace, version, and endpoints for the Stats API.
 *
 * @since 3.17.0
 */
class Stats_Controller extends REST_API_Controller {
	/**
	 * Gets the prefix for this API route.
	 *
	 * @since 3.17.0
	 *
	 * @return string The namespace.
	 */
	public static function get_route_prefix(): string {
		return 'stats';
	}

	/**
	 * Initializes the Stats API endpoints.
	 *
	 * @since 3.17.0
	 */
	public function init(): void {
		$endpoints = array(
			new Endpoint_Posts( $this ),
			new Endpoint_Post( $this ),
			new Endpoint_Related( $this ),
		);

		$this->register_endpoints( $endpoints );
	}
}

```
