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