| Conditions | 4 |
| Paths | 3 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
||
| 24 | |||
| 25 | unset( $field_options['search_filter'] ); |
||
| 26 | |||
| 27 | if ( 'edit' === $context ) { |
||
| 28 | return $field_options; |
||
| 29 | } |
||
| 30 | |||
| 31 | $field = \GV\GF_Field::by_id( \GV\GF_Form::by_id( $form_id ), $field_id ); |
||
| 32 | |||
| 33 | $add_options = array(); |
||
| 34 | |||
| 35 | if ( $field->field->inputType === 'likert' && $field->field->gsurveyLikertEnableScoring ) { |
||
| 36 | $add_options['score'] = array( |
||
| 37 | 'type' => 'checkbox', |
||
| 38 | 'label' => __( 'Show score', 'gravityview' ), |
||
| 39 | 'desc' => __( 'Display likert score as a simple number.', 'gravityview' ), |
||
| 40 | 'value' => false, |
||
| 41 | 'merge_tags' => false, |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | return $add_options + $field_options; |
||
| 46 | } |
||
| 47 | } |
||
| 50 |