12 public $icon =
'dashicons-editor-code';
22 $this->widget_description = __(
'Insert custom text or HTML as a widget',
'gk-gravityview' );
24 $default_values = array(
32 'label' => __(
'Custom Content',
'gk-gravityview' ),
33 'desc' => __(
'Enter text or HTML. Also supports shortcodes.',
'gk-gravityview' ),
36 'merge_tags' =>
false,
37 'show_all_fields' =>
true,
41 'label' => __(
'Automatically add paragraphs to content',
'gk-gravityview' ),
42 'tooltip' => __(
'Wrap each block of text in an HTML paragraph tag (recommended for text).',
'gk-gravityview' ),
45 'admin_label' => array(
48 'label' => __(
'Admin Label',
'gk-gravityview' ),
49 'desc' => __(
'A label that is only shown in the GravityView View configuration screen.',
'gk-gravityview' ),
54 parent::__construct( __(
'Custom Content',
'gk-gravityview' ) ,
'custom_content', $default_values,
$settings );
63 if( !empty( $widget_args[
'title'] ) ) {
64 echo $widget_args[
'title'];
69 if( !class_exists(
'GFFormDisplay' ) ) {
70 include_once( GFCommon::get_base_path() .
'/form_display.php' );
73 $widget_args[
'content'] = trim( rtrim( \
GV\Utils::get( $widget_args,
'content',
'' ) ) );
76 if( empty( $widget_args[
'content'] ) ) {
82 if( !empty( $widget_args[
'wpautop'] ) ) {
83 $widget_args[
'content'] = wpautop( $widget_args[
'content'] );
96 $class = !empty( $widget_args[
'custom_class'] ) ? $widget_args[
'custom_class'] :
'';
99 echo
'<div class="gv-widget-custom-content '.$class.
'">'.
$content .
'</div>';
new GravityView_Widget_Custom_Content
if(empty( $field_settings['content'])) $content
render_frontend( $widget_args, $content='', $context='')
gravityview()
The main GravityView wrapper function.
Widget to add custom content.