Completed
Push — master ( 228e92...6a576a )
by David
02:49
created

Wordlift_Url_Property_Service   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 8 2
1
<?php
2
3
/**
4
 * @since 3.8.0
5
 */
6
class Wordlift_Url_Property_Service extends Wordlift_Simple_Property_Service {
7
8
	const META_KEY = 'wl_schema_url';
9
10
	public function get( $post_id, $meta_key ) {
11
12
		// Convert <permalink> in actual permalink values.
13
		return array_map( function ( $item ) use ( $post_id ) {
14
15
			return '<permalink>' === $item ? get_permalink( $post_id ) : $item;
16
		}, parent::get( $post_id, $meta_key ) );
17
	}
18
19
}
20