GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gv-rest-core.php
Go to the documentation of this file.
1 <?php
2 namespace GV\REST;
3 
4 /** If this file is called directly, abort. */
5 if ( ! defined( 'GRAVITYVIEW_DIR' ) ) {
6  die();
7 }
8 
9 class Core {
10  public static $routes;
11 
12  /**
13  * Initialization.
14  */
15  public static function init() {
16  if ( ! gravityview()->plugin->supports( \GV\Plugin::FEATURE_REST ) ) {
17  return;
18  }
19 
20  /** Load routes. */
21  require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-route.php' );
22  require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-views-route.php' );
23 
24  self::$routes['views'] = $views = new Views_Route();
25  $views->register_routes();
26  }
27 
28  /**
29  * Get namespace for GravityView REST API endpoints
30  *
31  * @since 2.0
32  * @return string
33  */
34  public static function get_namespace() {
35  return 'gravityview/v1';
36 
37  }
38 
39  /**
40  * Get root URL for GravityView REST API
41  *
42  * @since 2.0
43  * @return string
44  */
45  public static function get_url() {
46  return rest_url( self::get_namespace() );
47  }
48 }
If this file is called directly, abort.
static get_url()
Get root URL for GravityView REST API.
static get_namespace()
Get namespace for GravityView REST API endpoints.
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.
static init()
Initialization.
const FEATURE_REST