GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
custom.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the HTML field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  * @since 1.2
8  */
9 
11 
12 extract( $gravityview_view->getCurrentField() );
13 
14 // Make sure the class is loaded in DataTables
15 if( !class_exists( 'GFFormDisplay' ) ) {
16  include_once( GFCommon::get_base_path() . '/form_display.php' );
17 }
18 
19 // Tell the renderer not to wrap this field in an anchor tag.
20 $gravityview_view->setCurrentFieldSetting('show_as_link', false);
21 
22 /**
23  * @filter `gravityview/fields/custom/content_before` Modify Custom Content field output before Merge Tag processing
24  * @since 1.6.2
25  * @param string $content HTML content of field
26  */
27 $field_settings['content'] = apply_filters( 'gravityview/fields/custom/content_before', $field_settings['content'] );
28 
29 $field_settings['content'] = trim( rtrim( (string) $field_settings['content'] ) );
30 
31 // No custom content
32 if( empty( $field_settings['content'] ) ) {
33  return;
34 }
35 
36 // Replace the variables
38 
39 /**
40  * @filter `gravityview/fields/custom/decode_shortcodes` Decode brackets in shortcodes
41  * @since 1.16.5
42  * @param boolean $decode Enable/Disable decoding of brackets in the content (default: false)
43  * @param string $content HTML content of field
44  */
45 if( apply_filters( 'gravityview/fields/custom/decode_shortcodes', false, $content ) ) {
47 }
48 
49 // Add paragraphs?
50 if( !empty( $field_settings['wpautop'] ) ) {
51  $content = wpautop( $content );
52 }
53 
54 /**
55  * @filter `gravityview/fields/custom/content_after` Modify Custom Content field output after Merge Tag variables get replaced, before shortcodes get processed
56  * @since 1.6.2
57  * @param string $content HTML content of field
58  */
59 $content = apply_filters( 'gravityview/fields/custom/content_after', $content );
60 
61 // Enqueue scripts needed for Gravity Form display, if form shortcode exists.
62 // Also runs `do_shortcode()`
63 echo GFCommon::gform_do_shortcode( $content );
static getInstance( $passed_post=NULL)
static decode_shortcodes( $string)
Inspired on ::encode_shortcodes, reverse the encoding by replacing the ascii characters by the shortc...
$field_settings['content']
Definition: custom.php:27
if(gravityview() ->plugin->is_GF_25()) $form
if(empty( $field_settings['content'])) $content
Definition: custom.php:37
$gravityview_view
Definition: custom.php:10
static replace_variables( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=true, $nl2br=true, $format='html', $aux_data=array())
Alias for GravityView_Merge_Tags::replace_variables()
Definition: class-api.php:118
$entry
Definition: notes.php:27