Completed
Push — develop ( e2ac27...b5f4d0 )
by Zack
04:24
created

GravityView_Field_Post_Content   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

1 Method

Rating   Name   Duplication   Size   Complexity  
A field_options() 0 12 2
1
<?php
2
3
/**
4
 * Add custom options for date fields
5
 */
6
class GravityView_Field_Post_Content extends GravityView_Field {
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 $group = 'post';
15
16
	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...
17
18
		unset( $field_options['show_as_link'] );
19
20
		if( 'edit' === $context ) {
21
			return $field_options;
22
		}
23
24
		$this->add_field_support('dynamic_data', $field_options );
25
26
		return $field_options;
27
	}
28
29
}
30
31
new GravityView_Field_Post_Content;
32