Completed
Push — master ( efa919...14faa5 )
by David
15:28 queued 07:41
created

Wordlift_PrimaShop_Adapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A prima_metabox_entity_header_args() 0 4 1
1
<?php
2
3
/**
4
 * A class that provides compatibility with PrimaShop, i.e. displays the Header options on Entity edit pages.
5
 *
6
 * @since 3.2.3
7
 */
8
class Wordlift_PrimaShop_Adapter {
9
10
	/**
11
	 * Create a Wordlift_PrimaShop_Adapter instance.
12
	 *
13
	 * @since 3.2.3
14
	 */
15
	public function __construct() {
16
17
		// Tell WP (and PrimaShop) that we support the *prima-layout-settings*. This will display the Content Settings
18
		// in the entity edit page.
19
		add_post_type_support( Wordlift_Entity_Service::TYPE_NAME, 'prima-layout-settings' );
20
21
	}
22
23
	/**
24
	 * Intercept the <em>prima_metabox_entity_header_args</em> filter and return what a call to the related <em>post</em>
25
	 * would have returned.
26
	 *
27
	 * @since 3.2.3
28
	 *
29
	 * @param array $meta The meta array.
30
	 * @param string $ype The post type.
31
	 *
32
	 * @return array A meta array.
33
	 */
34
	function prima_metabox_entity_header_args( $meta, $ype ) {
0 ignored issues
show
Unused Code introduced by
The parameter $ype is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
35
36
		return apply_filters( "prima_metabox_post_header_args", $meta, 'post' );
37
	}
38
39
}
40