| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 26 | function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
||
|
|
|||
| 27 | |||
| 28 | if( 'edit' === $context ) { |
||
| 29 | return $field_options; |
||
| 30 | } |
||
| 31 | |||
| 32 | $field_options['trim_words'] = array( |
||
| 33 | 'type' => 'number', |
||
| 34 | 'merge_tags' => false, |
||
| 35 | 'value' => null, |
||
| 36 | 'label' => __( 'Maximum words shown', 'gravityview' ), |
||
| 37 | 'tooltip' => __( 'Enter the number of words to be shown. If specified it truncates the text. Leave it blank if you want to show the full text.', 'gravityview' ), |
||
| 38 | ); |
||
| 39 | |||
| 40 | $field_options['make_clickable'] = array( |
||
| 41 | 'type' => 'checkbox', |
||
| 42 | 'merge_tags' => false, |
||
| 43 | 'value' => 0, |
||
| 44 | 'label' => __( 'Convert text URLs to HTML links', 'gravityview' ), |
||
| 45 | 'tooltip' => __( 'Converts URI, www, FTP, and email addresses in HTML links', 'gravityview' ), |
||
| 46 | ); |
||
| 47 | |||
| 48 | return $field_options; |
||
| 49 | } |
||
| 50 | |||
| 54 |
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.