GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
textarea.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the textarea field type
4  *
5  * Use wpautop() to format paragraphs, as expected, instead of line breaks like Gravity Forms displays by default.
6  *
7  * @package GravityView
8  * @subpackage GravityView/templates/fields
9  */
10 
12 
13 /**
14  * @var string $value
15  * @var array $field_settings
16  * @var array $entry
17  */
18 extract( $gravityview_view->getCurrentField() );
19 
20 /**
21  * @filter `gravityview/fields/textarea/allowed_kses` Allow the following HTML tags and strip everything else.
22  * @since 1.21.5.1
23  * @see $allowedposttags global in kses.php for an example of the format for passing an array of allowed tags and atts
24  * @see wp_kses_allowed_html() For allowed contexts
25  * @param array|string $allowed_html Context string (allowed strings are post, strip, data, entities, or the name of a field filter such as pre_user_description) or allowed tags array (see above). [Default: 'post']
26  */
27 $allowed_html = apply_filters( 'gravityview/fields/textarea/allowed_kses', 'post' );
28 
29 $value = wp_kses( $value, $allowed_html );
30 
31 if( !empty( $field_settings['trim_words'] ) ) {
32 
33  /**
34  * @filter `gravityview_excerpt_more` Modify the "Read more" link used when "Maximum Words" setting is enabled and the output is truncated
35  * @since 1.16.1
36  * @param string $excerpt_more Default: ` ...`
37  */
38  $excerpt_more = apply_filters( 'gravityview_excerpt_more', ' ' . '&hellip;' );
39 
40  $entry_link = GravityView_API::entry_link_html( $entry, $excerpt_more, array(), $field_settings );
41  $value = wp_trim_words( $value, $field_settings['trim_words'], $entry_link );
42  unset( $entry_link, $excerpt_more );
43 }
44 
45 if( !empty( $field_settings['make_clickable'] ) ) {
46  $value = make_clickable( $value );
47 }
48 
49 if( ! empty( $field_settings['new_window'] ) ) {
50  $value = links_add_target( $value );
51 }
52 
53 echo wpautop( $value );
$value
Definition: textarea.php:29
static getInstance( $passed_post=NULL)
$gravityview_view
Definition: textarea.php:11
$field_settings['content']
Definition: custom.php:27
static entry_link_html( $entry=array(), $anchor_text='', $passed_tag_atts=array(), $field_settings=array(), $base_id=null)
Generate an anchor tag that links to an entry.
Definition: class-api.php:259
$allowed_html
Definition: textarea.php:27
$entry
Definition: notes.php:27