Completed
Push — develop ( fc0354...e2ac27 )
by Zack
11:27 queued 07:24
created

GravityView_Field_Post_ID   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A field_options() 0 6 1
1
<?php
2
3
/**
4
 * Add custom options for Post ID fields
5
 *
6
 * @since 1.7
7
 */
8
class GravityView_Field_Post_ID extends GravityView_Field {
9
10
	var $name = 'post_id';
11
12
	var $label = 'Post ID';
13
14
	var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
15
16
	/**
17
	 * GravityView_Field_Post_ID constructor.
18
	 */
19
	public function __construct() {
20
		$this->label = __( 'Post ID', 'gravityview' );
21
		parent::__construct();
22
	}
23
24
	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
0 ignored issues
show
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...
25
26
		$this->add_field_support('link_to_post', $field_options );
27
28
		return $field_options;
29
	}
30
31
}
32
33
new GravityView_Field_Post_ID;
34