| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 37 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
||
|
|
|||
| 38 | |||
| 39 | // Always a link! |
||
| 40 | unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
||
| 41 | |||
| 42 | if( 'edit' === $context ) { |
||
| 43 | return $field_options; |
||
| 44 | } |
||
| 45 | |||
| 46 | $add_options = array(); |
||
| 47 | $add_options['entry_link_text'] = array( |
||
| 48 | 'type' => 'text', |
||
| 49 | 'label' => __( 'Link Text:', 'gravityview' ), |
||
| 50 | 'desc' => NULL, |
||
| 51 | 'value' => __('View Details', 'gravityview'), |
||
| 52 | 'merge_tags' => true, |
||
| 53 | ); |
||
| 54 | |||
| 55 | return $add_options + $field_options; |
||
| 56 | } |
||
| 57 | |||
| 61 |
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.