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

Wordlift_Url_Property_Service::get()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 1
nop 2
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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