gravityview /
GravityView
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * @file class-gravityview-field-post-excerpt.php |
||
| 4 | * @package GravityView |
||
| 5 | * @subpackage includes\fields |
||
| 6 | */ |
||
| 7 | |||
| 8 | class GravityView_Post_Excerpt extends GravityView_Field { |
||
| 9 | |||
| 10 | var $name = 'post_excerpt'; |
||
| 11 | |||
| 12 | var $is_searchable = true; |
||
| 13 | |||
| 14 | var $search_operators = array( 'contains', 'is', 'isnot', 'starts_with', 'ends_with' ); |
||
| 15 | |||
| 16 | var $_gf_field_class_name = 'GF_Field_Post_Excerpt'; |
||
| 17 | |||
| 18 | var $group = 'post'; |
||
| 19 | |||
| 20 | public function __construct() { |
||
| 21 | $this->label = esc_html__( 'Post Excerpt', 'gravityview' ); |
||
| 22 | parent::__construct(); |
||
| 23 | } |
||
| 24 | |||
| 25 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
||
|
0 ignored issues
–
show
|
|||
| 26 | |||
| 27 | unset( $field_options['show_as_link'] ); |
||
| 28 | |||
| 29 | if( 'edit' === $context ) { |
||
| 30 | return $field_options; |
||
| 31 | } |
||
| 32 | |||
| 33 | $this->add_field_support('dynamic_data', $field_options ); |
||
|
0 ignored issues
–
show
|
|||
| 34 | |||
| 35 | return $field_options; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | new GravityView_Post_Excerpt; |
||
| 40 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.