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

Settings_Tab   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect_hook() 0 15 1
1
<?php
2
3
namespace Wordlift\Vocabulary\Tabs;
4
5
use Wordlift\Vocabulary\Api\Api_Config;
6
7
/**
8
 * This class adds a tab to the wordlift settings screen.
9
 * @since 3.30.0
10
 * @author Naveen Muthusamy <[email protected]>
11
 * Class Settings_Tab
12
 * @package Wordlift\Vocabulary\Tabs
13
 */
14
class Settings_Tab {
15
16
	public function connect_hook() {
17
		add_filter( 'wl_admin_page_tabs', function ( $tabs ) {
18
			$tabs[] = array(
19
				'slug'  => 'match-terms',
20
				'title' => __( 'Match Terms', 'wordlift' )
21
			);
22
			return $tabs;
23
		} );
24
25
26
		add_filter('wl_admin_settings', function ( $settings ) {
27
			$settings['matchTerms'] = Api_Config::get_api_config();
28
			return $settings;
29
		});
30
	}
31
32
}