Completed
Push — master ( 3ac4b1...21157a )
by Zack
05:18
created

GravityView_Field_Post_ID::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * @file class-gravityview-field-post-id.php
4
 * @package GravityView
5
 * @subpackage includes\fields
6
 * @since 1.7
7
 */
8
9
/**
10
 * Add custom options for Post ID fields
11
 *
12
 * @since 1.7
13
 */
14
class GravityView_Field_Post_ID extends GravityView_Field {
15
16
	var $name = 'post_id';
17
18
	var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
19
20
	var $group = 'post';
21
22
	/**
23
	 * GravityView_Field_Post_ID constructor.
24
	 */
25
	public function __construct() {
26
		$this->label = __( 'Post ID', 'gravityview' );
27
		parent::__construct();
28
	}
29
30
	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...
31
32
		$this->add_field_support('link_to_post', $field_options );
33
34
		return $field_options;
35
	}
36
37
}
38
39
new GravityView_Field_Post_ID;
40