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

Api_Config::get_api_config()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
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