PluginProbe
WPGet API – Connect to any external REST API / 1.6.1
WPGet API – Connect to any external REST API v1.6.1
1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.10 2.2.2 2.2.3 All 97 releases
wpgetapi / includes / class-admin-options.php

class-admin-options.php in WPGet API – Connect to any external REST API 1.6.1, at includes/class-admin-options.php

697 lines 20.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Settings Required
4 *
5 */
6
7 // Exit if accessed directly.
8 if ( ! defined( 'ABSPATH' ) ) exit;
9
10 if ( ! class_exists( 'WpGetApi_Admin_Options' ) ) :
11
12 /**
13 * CMB2 Theme Options
14 * @version 0.1.0
15 */
16 class WpGetApi_Admin_Options {
17
18 /**
19 * Array of metaboxes/fields
20 * @var array
21 */
22 public $option_metabox = array();
23
24 /**
25 * Array of metaboxes/fields
26 * @var array
27 */
28 public $metabox_id = '';
29
30 /**
31 * Options Page title
32 * @var string
33 */
34 protected $title = '';
35
36 /**
37 * Options Page title
38 * @var string
39 */
40 protected $menu_title = '';
41
42 /**
43 * Options Tab Pages
44 * @var array
45 */
46 public $options_pages = array();
47
48 /**
49 * Holds an instance of the object
50 *
51 * @var Myprefix_Admin
52 **/
53 private static $instance = null;
54
55 /**
56 * Constructor
57 * @since 0.1.0
58 */
59 private function __construct() {
60 // Set our title
61 $this->menu_title = __( 'WPGetAPI', 'wpgetapi' );
62 $this->title = __( 'WPGetAPI', 'wpgetapi' );
63 }
64
65 /**
66 * Returns the running object
67 *
68 * @return Myprefix_Admin
69 **/
70 public static function get_instance() {
71 if( is_null( self::$instance ) ) {
72 self::$instance = new self();
73 self::$instance->hooks();
74 }
75 return self::$instance;
76 }
77
78 /**
79 * Initiate our hooks
80 * @since 0.1.0
81 */
82 public function hooks() {
83 add_action( 'admin_init', array( $this, 'init' ) );
84 add_action( 'admin_menu', array( $this, 'add_options_pages' ) );
85
86 add_action( 'cmb2_admin_init', array( $this, 'init_custom_fields' ) );
87
88 add_action( "cmb2_save_options-page_fields", array( $this, 'redirect' ), 1, 2 );
89
90 add_action( 'admin_footer', array( $this, 'load_testing_javascript' ) );
91
92 add_action( 'wp_ajax_wpgetapi_test_endpoint', array( $this, 'test_the_endpoint' ) );
93
94 }
95
96
97 /**
98 * Setup our custom fields
99 * @since 0.1.0
100 */
101 public function init_custom_fields() {
102 require_once WPGETAPIDIR . 'includes/class-fields.php';
103 WpGetApi_Parameter_Field::init_parameter();
104 }
105
106 /**
107 * Register our setting to WP
108 * @since 0.1.0
109 */
110 public function init() {
111 $option_tabs = self::option_fields();
112 foreach ($option_tabs as $index => $option_tab) {
113 register_setting( $option_tab['id'], $option_tab['id'] );
114 }
115 }
116
117
118 /**
119 * Get our saved API's from setup
120 * @since 0.1.0
121 */
122 public function get_apis() {
123 $setup = get_option( 'wpgetapi_setup' );
124 if( empty( $setup ) || ! isset( $setup['apis'] ) || empty( $setup['apis'] ) )
125 return;
126 return $setup['apis'];
127 }
128
129
130 /**
131 * Add the options metabox to the array of metaboxes
132 * @since 0.1.0
133 */
134 public function option_fields() {
135
136 //Only need to initiate the array once per page-load
137 if ( ! empty( $this->option_metabox ) ) {
138 return $this->option_metabox;
139 }
140
141 // setup tab
142 $option_metabox[] = array(
143 'title' => __( 'Setup', 'wpgetapi' ),
144 'menu_title' => __( 'Setup', 'wpgetapi' ),
145 'id' => 'wpgetapi_setup',
146 'desc' => __( 'Add the details of the API(s) you are using. Endpoints will be setup in the next step after saving your API(s).', 'wpgetapi' ),
147 'show_on' => array( 'key' => 'options-page', 'value' => array( 'wpgetapi_setup' ), ),
148 'show_names' => true,
149 'fields' => $this->setup_fields(),
150 );
151
152 // get our saved API's and create as tabs
153 if( $this->get_apis() ) {
154
155 foreach ( $this->get_apis() as $index => $api ) {
156
157 $name = isset( $api['name'] ) && $api['name'] != '' ? sanitize_text_field( $api['name'] ) : 'API ' . absint( $index );
158 $api_id = isset( $api['id'] ) && $api['id'] != '' ? sanitize_text_field( $api['id'] ) : $name;
159 $metabox_id = strtolower( str_replace( '-', '_', sanitize_file_name( 'wpgetapi-' . $api_id ) ) );
160 $base_url = isset( $api['base_url'] ) && $api['base_url'] != '' ? esc_url_raw( $api['base_url'], array( 'http', 'https' ) ) : '';
161 $type = isset( $api['auth_type'] ) && $api['auth_type'] != '' ? sanitize_text_field( $api['auth_type'] ) : '';
162
163 // tab
164 $option_metabox[] = array(
165 'title' => $name,
166 'menu_title' => $name,
167 'id' => $metabox_id,
168 'desc' => '',
169 'show_on' => array( 'key' => 'options-page', 'value' => array( $metabox_id ), ),
170 'show_names' => true,
171 'fields' => $this->endpoint_fields( $type, $api_id, $base_url ),
172 );
173
174 }
175
176 }
177
178 $option_metabox = apply_filters( 'wpgetapi_admin_pages', $option_metabox );
179
180 return $option_metabox;
181
182 }
183
184 public function setup_fields() {
185
186 $fields[] = array(
187 'id' => 'apis',
188 'type' => 'group',
189 'name' => '',
190 'description' => '',
191 'options' => array(
192 'group_title' => __( 'API {#}', 'wpgetapi' ),
193 'add_button' => __( 'Add New API', 'wpgetapi' ),
194 'remove_button' => __( 'Remove API', 'wpgetapi' ),
195 'sortable' => true, // beta
196 ),
197 'fields' => array(
198 array(
199 'name' => __( 'API Name', 'wpgetapi' ),
200 'id' => 'name',
201 'type' => 'text',
202 'attributes' => array(
203 'required' => true,
204 'placeholder' => 'Google Maps',
205 ),
206 'desc' => __( 'The name of the API you are connecting to.', 'wpgetapi' ),
207 ),
208 array(
209 'name' => __( 'Unique ID', 'wpgetapi' ),
210 'id' => 'id',
211 'type' => 'text',
212 'attributes' => array(
213 'required' => true,
214 'placeholder' => 'google_maps',
215 ),
216 'desc' => __( 'A unique ID for your API. Lowercase letters and underscores only.', 'wpgetapi' ),
217 ),
218 array(
219 'name' => __( 'Base URL', 'wpgetapi' ),
220 'id' => 'base_url',
221 'type' => 'text',
222 'attributes' => array(
223 'required' => true,
224 'placeholder' => 'https://maps.googleapis.com/maps/api',
225 ),
226 'desc' => __( 'The base URL of the API you are connecting to.', 'wpgetapi' ),
227 ),
228
229 )
230 );
231
232 return $fields;
233
234 }
235
236
237 /**
238 * Endpoint settings.
239 * @return sale info array
240 *
241 */
242 public function endpoint_fields( $type = '', $api_id = '', $base_url = '' ) {
243
244 $fields = array();
245
246 $endpoint_fields = apply_filters( 'wpgetapi_fields_endpoints', array(
247 array(
248 'name' => __( 'Unique ID', 'wpgetapi' ),
249 'id' => 'id',
250 'type' => 'text',
251 'classes' => 'field-id',
252 'attributes' => array(
253 'required' => true,
254 'placeholder' => 'new_endpoint',
255 ),
256 'desc' => __( 'A unique ID for this endpoint. Lowercase letters and underscores only.', 'wpgetapi' ),
257 'before_row' => "wpgetapi_output_top_of_endpoint",
258 'api_id' => $api_id,
259
260 ),
261 array(
262 'name' => __( 'Endpoint', 'wpgetapi' ),
263 'id' => 'endpoint',
264 'type' => 'text',
265 'classes' => 'field-endpoint',
266 'attributes' => array(
267 'required' => true,
268 'placeholder' => '/newendpoint',
269 ),
270 'desc' => __( 'The endpoint that will be appended to the base URL.', 'wpgetapi' ),
271 ),
272 array(
273 'name' => __( 'Method', 'wpgetapi' ),
274 'id' => 'method',
275 'type' => 'select',
276 'classes' => 'field-method',
277 'attributes' => array(
278 'required' => true,
279 ),
280 'options' => array(
281 'GET' => 'GET',
282 'POST' => 'POST',
283 'PUT' => 'PUT',
284 ),
285 'desc' => __( 'The request method for this endpoint.', 'wpgetapi' ),
286 ),
287 array(
288 'name' => __( 'Results Format', 'wpgetapi' ),
289 'id' => 'results_format',
290 'type' => 'select',
291 'classes' => 'field-results-format',
292 'attributes' => array(
293 'required' => true,
294 ),
295 'options_cb' => 'wpgetapi_results_format_options',
296 'desc' => __( 'The format of the results.', 'wpgetapi' ),
297 ),
298 array(
299 'name' => __( 'Query String', 'wpgetapi' ),
300 'id' => 'query_parameters',
301 'type' => 'parameter',
302 'classes' => 'field-query-parameters',
303 'repeatable' => true,
304 'desc' => sprintf(
305 __( 'Parameters as name/value pairs that will be appended to the URL. %1s', 'wpgetapi' ),
306 '<a target="_blank" href="https://wpgetapi.com/docs/adding-query-string-parameters/?utm_campaign=Query String&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
307 )
308 ),
309 array(
310 'name' => __( 'Headers', 'wpgetapi' ),
311 'id' => 'header_parameters',
312 'type' => 'parameter',
313 'classes' => 'field-header-parameters',
314 'repeatable' => true,
315 'desc' => sprintf(
316 __( 'Parameters as name/value pairs, sent in the headers. %1s', 'wpgetapi' ),
317 '<a target="_blank" href="https://wpgetapi.com/docs/sending-headers-in-request/?utm_campaign=Headers&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
318 )
319 ),
320 array(
321 'name' => __( 'Body POST Fields', 'wpgetapi' ),
322 'id' => 'body_parameters',
323 'type' => 'parameter',
324 'classes' => 'field-body-parameters',
325 'repeatable' => true,
326 'desc' => sprintf(
327 __( 'Parameters as name/value pairs, sent in the body as POST fields. %1s', 'wpgetapi' ),
328 '<a target="_blank" href="https://wpgetapi.com/docs/sending-headers-in-request/?utm_campaign=Body&utm_medium=Admin&utm_source=User">Help <span class="dashicons dashicons-external"></span></a>'
329 )
330 ),
331 array(
332 'name' => __( 'Encode Body', 'wpgetapi' ),
333 'id' => 'body_json_encode',
334 'type' => 'select',
335 'classes' => 'field-body-json-encode',
336 'options' => array(
337 'false' => __( 'No encoding', 'wpgetapi' ),
338 'true' => __( 'JSON encode', 'wpgetapi' ),
339 'url' => __( 'URL encode', 'wpgetapi' ),
340 ),
341 'desc' => __( 'Should Body parameters be encoded (if set). ', 'wpgetapi' ),
342 ),
343 ) );
344
345
346 $fields[] = array(
347 'id' => 'endpoints',
348 'type' => 'group',
349 'name' => '',
350 'description' => '',
351 'options' => array(
352 'group_title' => __( 'Endpoint {#}', 'wpgetapi' ),
353 'add_button' => __( 'Add Endpoint', 'wpgetapi' ),
354 'remove_button' => __( 'Remove Endpoint', 'wpgetapi' ),
355 'sortable' => true, // beta
356 ),
357 'before_group' => '<pre class="url">Base URL: <span>' . $base_url . '</span></pre>',
358 'fields' => $endpoint_fields,
359 );
360
361 return apply_filters( 'wpgetapi_fields', $fields );
362
363 }
364
365
366
367
368 public function add_options_pages() {
369
370 $option_tabs = self::option_fields();
371
372 foreach ($option_tabs as $index => $option_tab) {
373 if ( $index == 0) {
374
375 $this->options_pages[] = add_menu_page( $this->title, $this->menu_title, 'manage_options', $option_tab['id'], array( $this, 'admin_page_display' ), 'dashicons-editor-code'
376 ); //Link admin menu to first tab
377
378 add_submenu_page( $option_tabs[0]['id'], $this->menu_title, $option_tab['menu_title'], 'manage_options', $option_tab['id'], array( $this, 'admin_page_display' ) ); //Duplicate menu link for first submenu page
379 } else {
380 $this->options_pages[] = add_submenu_page( $option_tabs[0]['id'], $this->menu_title, $option_tab['menu_title'], 'manage_options', $option_tab['id'], array( $this, 'admin_page_display' ) );
381 }
382 }
383
384 foreach ( $this->options_pages as $page ) {
385 // Include CMB CSS in the head to avoid FOUC
386 add_action( "admin_print_styles-{$page}", array( 'CMB2_Hookup', 'enqueue_cmb_css' ) );
387 }
388
389 }
390
391 /**
392 * Admin page markup. Mmply handled by CMB2
393 * @since 0.1.0
394 */
395 public function admin_page_display() {
396
397 $option_tabs = self::option_fields(); //get all option tabs
398 $tab_forms = array();
399 ?>
400
401 <div class="wrap wpgetapi">
402
403 <div class="main_content_cell">
404
405 <h1 class="wp-heading-inline"><?php esc_html_e( $this->title, 'wpgetapi' ) ?></h1>
406 <!-- Options Page Nav Tabs -->
407 <h2 class="nav-tab-wrapper">
408 <?php foreach ($option_tabs as $option_tab) :
409 $tab_slug = $option_tab['id'];
410 $nav_class = 'nav-tab';
411 if ( $tab_slug == $_GET['page'] ) {
412 $nav_class .= ' nav-tab-active'; //add active class to current tab
413 $tab_forms[] = $option_tab; //add current tab to forms to be rendered
414 }
415 ?>
416 <a class="<?php esc_attr_e( $nav_class ); ?>" href="<?php esc_url( menu_page_url( $tab_slug ) ); ?>"><?php esc_attr_e( $option_tab['menu_title'], 'wpgetapi' ); ?></a>
417 <?php endforeach; ?>
418 </h2>
419 <!-- End of Nav Tabs -->
420
421 <?php foreach ($tab_forms as $tab_form) : //render all tab forms (normaly just 1 form)
422
423 ?>
424
425 <div id="<?php esc_attr_e($tab_form['id']); ?>" class="cmb-form group">
426 <div class="metabox-holder">
427 <div class="pmpbox pad">
428 <h3 class="title"><?php esc_html_e($tab_form['title'], 'wpgetapi'); ?></h3>
429 <div class="desc"><?php echo wp_kses_post( $tab_form['desc'] ); ?></div>
430 <?php cmb2_metabox_form( $tab_form, $tab_form['id'], $tab_form ); ?>
431 </div>
432 </div>
433 </div>
434
435 <?php endforeach; ?>
436
437 </div>
438
439 <div class="sidebar_cell">
440
441 <?php
442 $sidebar = self::sidebar_display();
443 echo apply_filters( 'wpgetapi_admin_sidebar_display', $sidebar );
444 ?>
445
446 </div>
447
448 </div>
449
450 <?php
451
452 }
453
454
455 public function test_the_endpoint() {
456
457 $api_id = sanitize_text_field( $_POST['api_id'] );
458 $endpoint_id = sanitize_text_field( $_POST['endpoint_id'] );
459 $data = wpgetapi_endpoint( $api_id, $endpoint_id, array( 'debug' => true ) );
460
461 $output = array(
462 'data' => $data,
463 'endpoint_id' => $endpoint_id
464 );
465 echo json_encode( $output );
466
467 wp_die(); // this is required to terminate immediately and return a proper response
468
469 }
470
471
472 public function load_testing_javascript() { ?>
473
474 <script type="text/javascript" >
475
476 jQuery(document).ready(function($) {
477
478 $('body').on( 'click', '.wpgetapi-test-area .test-button', function(){//delegated
479
480 var $this = $(this);
481 var area = $this.parents( '.wpgetapi-test-area' );
482 var api_id = $( area ).data( 'api' );
483 var endpoint_id = $( area ).data( 'endpoint' );
484
485 // disable button
486 $this.attr( 'disabled', true );
487
488 var data = {
489 'action': 'wpgetapi_test_endpoint',
490 'api_id': api_id,
491 'endpoint_id': endpoint_id
492 };
493
494 // send and get response
495 jQuery.post(ajaxurl, data, function( response ) {
496
497 var output = JSON.parse( response );
498 console.log( output.endpoint_id );
499
500 jQuery( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .handle' ).show();
501
502 jQuery( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .wpgetapi-result' ).html(
503 '<div class="side-notice"><p>Below is a test connection to your endpoint with debug mode enabled.<br>' +
504 'This is to check you are communicating with your API correctly.<br>' +
505 'The data can be formatted any way you like on the front end.</p></div>' +
506 output.data
507 );
508
509 // enable button
510 $( '.wpgetapi-test-area[data-endpoint="' + output.endpoint_id + '"] .test-button' ).attr( 'disabled', false );
511
512 });
513
514 });
515
516 $( '.wpgetapi-test-area .handle' ).on('click', function() {
517 $('.wpgetapi-result').toggle();
518 });
519
520 });
521
522 </script> <?php
523
524 }
525
526
527 /**
528 * Sidebar markup.
529 * @since 1.4.1
530 */
531 public function sidebar_display() {
532
533 ob_start();
534
535 // do our setup page
536 if( isset( $_GET['page'] ) && $_GET['page'] === 'wpgetapi_setup' )
537 return $this->sidebar_setup_page();
538
539 ?>
540
541 <div class="box">
542 <h3><?php esc_html_e( 'Endpoint Instructions', 'wpgetapi' ); ?></h3>
543 <ol>
544 <li><?php esc_html_e( 'Fill in the Unique ID and Endpoint.', 'wpgetapi' ); ?></li>
545 <li><?php esc_html_e( 'Set the Method.', 'wpgetapi' ); ?></li>
546 <li><?php esc_html_e( 'Set the desired Results Format.', 'wpgetapi' ); ?></li>
547 <li><?php esc_html_e( 'The rest of the fields are optional and will depend on the API you using.', 'wpgetapi' ); ?></li>
548 <li><?php esc_html_e( 'Hit the Save button.', 'wpgetapi' ); ?></li>
549 <li><?php esc_html_e( 'After saving, copy the Template Tag or the Shortcode and paste into appropriate place.', 'wpgetapi' ); ?></li>
550 </ol>
551 </div>
552
553 <hr>
554
555 <div class="box">
556 <strong><?php esc_html_e( 'Notes', 'wpgetapi' ); ?></strong>
557 <ul>
558 <li><?php esc_html_e( 'The Unique ID can be whatever you like but must contain only lowercase letters and underscores. This is used to identify each endpoint within the plugin.', 'wpgetapi' ); ?></li>
559 <li><?php esc_html_e( 'The Endpoint can be found in the documentation of your API.', 'wpgetapi' ); ?></li>
560 </ul>
561 </div>
562
563 <hr>
564
565 <div class="box">
566 <strong><?php esc_html_e( 'Getting Help', 'wpgetapi' ); ?></strong>
567 <ul>
568 <li><?php
569 printf(
570 esc_html__( 'Visit our website for guides on %1$s or %2$s.', 'cmb2' ),
571 '<a target="_blank" href="https://wpgetapi.com/docs/using-the-shortcode/?utm_campaign=Shortcode&utm_medium=Admin&utm_source=User">Using the Shortcode</a>',
572 '<a target="_blank" href="https://wpgetapi.com/docs/using-the-template-function/?utm_campaign=Template Tag&utm_medium=Admin&utm_source=User">Template Tag</a>'
573 );
574 ?></li>
575 </ul>
576 </div>
577
578 <?php
579 $content = ob_get_contents();
580 ob_end_clean();
581 return $content;
582
583 }
584
585
586 /**
587 * Sidebar for our setup page.
588 * @since 1.4.4
589 */
590 public function sidebar_setup_page() {
591
592 ob_start();
593 ?>
594
595 <div class="box">
596 <h3><?php esc_html_e( 'Setup Instructions', 'wpgetapi' ); ?></h3>
597 <ol>
598 <li><?php esc_html_e( 'Fill in the API Name, Unique ID and Base URL of your API.', 'wpgetapi' ); ?></li>
599 <li><?php esc_html_e( 'Hit the Save button.', 'wpgetapi' ); ?></li>
600 <li><?php esc_html_e( 'After saving, visit the new tab that will be created.', 'wpgetapi' ); ?></li>
601 </ol>
602 </div>
603
604 <hr>
605
606 <div class="box">
607 <strong><?php esc_html_e( 'Notes', 'wpgetapi' ); ?></strong>
608 <ul>
609 <li><?php esc_html_e( 'The API Name and Unique ID can be whatever you like but must contain only lowercase letters and underscores. These are used to identify each API within the plugin.', 'wpgetapi' ); ?></li>
610 <li><?php esc_html_e( 'The Base URL can be found in the documentation of your API.', 'wpgetapi' ); ?></li>
611 </ul>
612 </div>
613
614 <hr>
615
616 <div class="box">
617 <strong><?php esc_html_e( 'Getting Help', 'wpgetapi' ); ?></strong>
618 <ul>
619 <li><?php
620 printf(
621 esc_html__( 'Visit our website to view %1$s or %2$s.', 'cmb2' ),
622 '<a target="_blank" href="https://wpgetapi.com/docs/quick-start-guide/?utm_campaign=Quick Start&utm_medium=Admin&utm_source=User">Quick Start Guide</a>',
623 '<a target="_blank" href="https://wpgetapi.com/docs/step-by-step-example/?utm_campaign=Step by Step&utm_medium=Admin&utm_source=User">Step by Step Example</a>'
624 );
625 ?></li>
626 </ul>
627 </div>
628
629 <?php
630 $content = ob_get_contents();
631 ob_end_clean();
632 return $content;
633
634 }
635
636 /**
637 * Tabs don't immmediately appear on save, so this hack!
638 * @since 0.1.0
639 */
640 public function redirect( $object_id, $updated ) {
641
642 if( $object_id == 'wpgetapi_setup' ) {
643
644 add_settings_error( 'wpgetapi-notices', '', 'Settings saved, reloading page...', 'updated' );
645 settings_errors( 'wpgetapi-notices' );
646 ?>
647
648 <script>
649 setTimeout(function() {
650 location.reload();
651 }, 1000);
652 </script>
653 <?php
654
655 } else if ( strpos( $object_id, 'wpgetapi_' ) !== false ) {
656
657 $text = apply_filters( 'wpgetapi_admin_notice_text', __( 'Settings saved.', 'wpgetapi' ), $object_id );
658 add_settings_error( 'wpgetapi-notices', '', $text, 'updated' );
659 settings_errors( 'wpgetapi-notices' );
660
661 }
662
663 }
664
665
666 /**
667 * Public getter method for retrieving protected/private variables
668 * @since 0.1.0
669 * @param string $field Field to retrieve
670 * @return mixed Field value or exception is thrown
671 */
672 public function __get( $field ) {
673 // Allowed fields to retrieve
674 if ( in_array( $field, array( 'key', 'fields', 'title', 'options_pages' ), true ) ) {
675 return $this->{$field};
676 }
677 if ( 'option_metabox' === $field ) {
678 return $this->option_fields();
679 }
680 throw new Exception( 'Invalid property: ' . $field );
681 }
682
683 }
684
685 /**
686 * Helper function to get/return the WpGetApi_Admin_Options object
687 * @since 0.1.0
688 * @return WpGetApi_Admin_Options object
689 */
690 function wpgetapi_admin_options() {
691 return WpGetApi_Admin_Options::get_instance();
692 }
693
694 // Get it started
695 wpgetapi_admin_options();
696
697 endif;