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

GravityView_Field_Post_Content::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 4
Ratio 100 %
Metric Value
dl 4
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * Add custom options for date fields
5
 */
6 View Code Duplication
class GravityView_Field_Post_Content extends GravityView_Field {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
8
	var $name = 'post_content';
9
10
	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
11
12
	var $_gf_field_class_name = 'GF_Field_Post_Content';
13
14
	var $label = 'Body';
15
16
	public function __construct() {
17
		$this->label = esc_attr__( 'Body', 'gravityview' );
18
		parent::__construct();
19
	}
20
21
	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...
22
23
		unset( $field_options['show_as_link'] );
24
25
		if( 'edit' === $context ) {
26
			return $field_options;
27
		}
28
29
		$this->add_field_support('dynamic_data', $field_options );
30
31
		return $field_options;
32
	}
33
34
}
35
36
new GravityView_Field_Post_Content;
37