| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 24 | function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
||
|
|
|||
| 25 | |||
| 26 | // If this is NOT the full address field, return default options. |
||
| 27 | if( floor( $field_id ) !== floatval( $field_id ) ) { |
||
| 28 | return $field_options; |
||
| 29 | } |
||
| 30 | |||
| 31 | if( 'edit' === $context ) { |
||
| 32 | return $field_options; |
||
| 33 | } |
||
| 34 | |||
| 35 | $add_options = array(); |
||
| 36 | |||
| 37 | $add_options['show_map_link'] = array( |
||
| 38 | 'type' => 'checkbox', |
||
| 39 | 'label' => __( 'Show Map Link:', 'gravityview' ), |
||
| 40 | 'desc' => __('Display a "Map It" link below the address', 'gravityview'), |
||
| 41 | 'value' => true, |
||
| 42 | 'merge_tags' => false, |
||
| 43 | ); |
||
| 44 | |||
| 45 | return $add_options + $field_options; |
||
| 46 | } |
||
| 47 | |||
| 51 |
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.