Completed
Push — develop ( e7ebe2...e67c0e )
by Naveen
29s queued 12s
created

Terms_Compat::get_terms()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
namespace Wordlift\Vocabulary;
3
4
class Terms_Compat {
5
6
	public static function get_terms( $taxonomy, $args_with_taxonomy_key ) {
7
		global $wp_version;
8
9
		if ( version_compare( $wp_version, '4.5', '<' ) ) {
10
			return get_terms( $taxonomy, $args_with_taxonomy_key );
11
		} else {
12
			$args_with_taxonomy_key['taxonomy'] = $taxonomy;
13
			return get_terms( $args_with_taxonomy_key );
14
		}
15
	}
16
17
	public static function get_public_taxonomies() {
18
		return get_taxonomies( array( 'public' => true ) );
19
	}
20
21
22
}