Completed
Pull Request — develop (#1328)
by Naveen
03:10
created

Api_Config   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_api_config() 0 12 1
1
<?php
2
3
namespace Wordlift\Vocabulary\Api;
4
5
/**
6
 * @since 1.0.0
7
 * @author Naveen Muthusamy <[email protected]>
8
 */
9
class Api_Config {
10
11
	const REST_NAMESPACE = 'cafemediakg/v1';
12
13
	public static function get_api_config() {
14
		// Create ui settings array to be used by js client.
15
		$settings            = array();
16
		$settings['restUrl'] = get_rest_url(
17
			null,
18
			Api_Config::REST_NAMESPACE . '/tags'
19
		);
20
		$settings['baseUrl'] = get_rest_url( null, Api_Config::REST_NAMESPACE );
21
		$settings['nonce']   = wp_create_nonce( 'wp_rest' );
22
23
		return $settings;
24
	}
25
26
}
27