@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | function __construct() { |
| 21 | 21 | |
| 22 | - $this->widget_description = __('Insert custom text or HTML as a widget', 'gravityview' ); |
|
| 22 | + $this->widget_description = __( 'Insert custom text or HTML as a widget', 'gravityview' ); |
|
| 23 | 23 | |
| 24 | 24 | $default_values = array( |
| 25 | 25 | 'header' => 1, |
@@ -44,39 +44,39 @@ discard block |
||
| 44 | 44 | ), |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | - parent::__construct( __( 'Custom Content', 'gravityview' ) , 'custom_content', $default_values, $settings ); |
|
| 47 | + parent::__construct( __( 'Custom Content', 'gravityview' ), 'custom_content', $default_values, $settings ); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
| 50 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
| 51 | 51 | |
| 52 | - if( !$this->pre_render_frontend() ) { |
|
| 52 | + if ( ! $this->pre_render_frontend() ) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if( !empty( $widget_args['title'] ) ) { |
|
| 57 | - echo $widget_args['title']; |
|
| 56 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
| 57 | + echo $widget_args[ 'title' ]; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | // Make sure the class is loaded in DataTables |
| 62 | - if( !class_exists( 'GFFormDisplay' ) ) { |
|
| 62 | + if ( ! class_exists( 'GFFormDisplay' ) ) { |
|
| 63 | 63 | include_once( GFCommon::get_base_path() . '/form_display.php' ); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $widget_args['content'] = trim( rtrim( \GV\Utils::get( $widget_args, 'content' ) ) ); |
|
| 66 | + $widget_args[ 'content' ] = trim( rtrim( \GV\Utils::get( $widget_args, 'content' ) ) ); |
|
| 67 | 67 | |
| 68 | 68 | // No custom content |
| 69 | - if( empty( $widget_args['content'] ) ) { |
|
| 69 | + if ( empty( $widget_args[ 'content' ] ) ) { |
|
| 70 | 70 | gravityview()->log->debug( 'No content.' ); |
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // Add paragraphs? |
| 75 | - if( !empty( $widget_args['wpautop'] ) ) { |
|
| 76 | - $widget_args['content'] = wpautop( $widget_args['content'] ); |
|
| 75 | + if ( ! empty( $widget_args[ 'wpautop' ] ) ) { |
|
| 76 | + $widget_args[ 'content' ] = wpautop( $widget_args[ 'content' ] ); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $content = $widget_args['content']; |
|
| 79 | + $content = $widget_args[ 'content' ]; |
|
| 80 | 80 | |
| 81 | 81 | $content = GravityView_Merge_Tags::replace_variables( $content, array(), array(), false, true, false ); |
| 82 | 82 | |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | // Add custom class |
| 89 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
| 89 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
| 90 | 90 | $class = gravityview_sanitize_html_class( $class ); |
| 91 | 91 | |
| 92 | - echo '<div class="gv-widget-custom-content '.$class.'">'. $content .'</div>'; |
|
| 92 | + echo '<div class="gv-widget-custom-content ' . $class . '">' . $content . '</div>'; |
|
| 93 | 93 | |
| 94 | 94 | } |
| 95 | 95 | |