# charitable/1.8.13/includes/abstracts/abstract-class-charitable-api-route.php

Charitable – Donation &amp; Fundraising Platform (Donation Forms, Recurring Donations &amp; Fundraising Campaigns), version 1.8.13. 68 lines.

- Page: https://pluginprobe.com/plugins/charitable/1.8.13/code/includes/abstracts/abstract-class-charitable-api-route.php
- Raw: https://pluginprobe.com/plugins/charitable/1.8.13/raw/includes/abstracts/abstract-class-charitable-api-route.php
- Modified: 2023-11-01T16:41:02+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/charitable/1.8.13/code/includes/abstracts/abstract-class-charitable-api-route.php#L10-L20`.

```php
<?php
/**
 * Base class for Charitable API routes.
 *
 * @package   Charitable/Classes/Charitable_API_Route
 * @author    David Bisset
 * @copyright Copyright (c) 2023, WP Charitable LLC
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since     1.6.0
 * @version   1.6.0
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'Charitable_API_Route' ) ) :

	/**
	 * Charitable_API_Route
	 *
	 * @since 1.6.0
	 */
	abstract class Charitable_API_Route extends WP_REST_Controller {

		/**
		 * Namespace.
		 *
		 * @since 1.6.0
		 *
		 * @var   string
		 */
		protected $namespace;

		/**
		 * API version.
		 *
		 * @since 1.6.0
		 *
		 * @var   int
		 */
		protected $version;

		/**
		 * Set up API namespace.
		 *
		 * @since 1.6.0
		 */
		public function __construct() {
			$this->version   = 1;
			$this->namespace = 'charitable/v' . $this->version;
		}

		/**
		 * Returns whether the current user can export Charitable reports.
		 *
		 * @since  1.6.0
		 *
		 * @return boolean
		 */
		public function user_can_get_charitable_reports() {
			return current_user_can( 'export_charitable_reports' );
		}
	}

endif;

```
