Completed
Push — master ( c8709b...1bb8b3 )
by David
02:56
created

Wordlift_Install_3_23_4   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A install() 0 22 2
1
<?php
2
/**
3
 * Installs: Install 3.23.4.
4
 *
5
 * Install the WebPage term.
6
 *
7
 * @since 3.23.4
8
 */
9
10
/**
11
 * Define the {@link Wordlift_Install_3_23_4} class.
12
 *
13
 * @since 3.23.4
14
 */
15
class Wordlift_Install_3_23_4 extends Wordlift_Install {
16
17
	/**
18
	 * {@inheritdoc}
19
	 */
20
	protected static $version = '3.23.4';
21
22
	public function install() {
23
24
		$term = get_term_by( 'slug', 'web-page', Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME );
25
26
		// Bail out if term exists.
27
		if ( false !== $term ) {
28
			return;
29
		}
30
31
		wp_insert_term(
32
			'WebPage',
33
			Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME,
34
			array(
35
				'slug'        => 'web-page',
36
				'description' => 'A Web Page.',
37
			)
38
		);
39
40
		update_term_meta( $term->term_id, '_wl_name', 'WebPage' );
41
		update_term_meta( $term->term_id, '_wl_uri', "http://schema.org/WebPage" );
42
43
	}
44
45
}
46