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

GravityView_Field_Post_Image::__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
/**
4
 * Add custom options for Post Image fields
5
 */
6
class GravityView_Field_Post_Image extends GravityView_Field {
7
8
	var $name = 'post_image';
9
10
	var $_gf_field_class_name = 'GF_Field_Post_Image';
11
12
	var $label = 'Post Image';
13
14
	public function __construct() {
15
		$this->label = __( 'Post Image', 'gravityview' );
16
		parent::__construct();
17
	}
18
19
	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...
20
21
		unset ( $field_options['search_filter'] );
22
23
		if( 'edit' === $context ) {
24
			return $field_options;
25
		}
26
27
		$this->add_field_support('link_to_post', $field_options );
28
29
		// @since 1.5.4
30
		$this->add_field_support('dynamic_data', $field_options );
31
32
		return $field_options;
33
	}
34
35
}
36
37
new GravityView_Field_Post_Image;
38