@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
32 | 32 | |
33 | 33 | // It makes no sense to use this as the link. |
34 | - unset( $field_options['show_as_link'] ); |
|
34 | + unset( $field_options[ 'show_as_link' ] ); |
|
35 | 35 | |
36 | - if( 'edit' === $context ) { |
|
36 | + if ( 'edit' === $context ) { |
|
37 | 37 | return $field_options; |
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @since 1.8 |
42 | 42 | */ |
43 | - $field_options['anchor_text'] = array( |
|
43 | + $field_options[ 'anchor_text' ] = array( |
|
44 | 44 | 'type' => 'text', |
45 | 45 | 'label' => __( 'Link Text:', 'gravityview' ), |
46 | 46 | 'desc' => __( 'Define custom link text. Leave blank to display the URL', 'gravityview' ), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | 'priority' => 1000, |
50 | 50 | ); |
51 | 51 | |
52 | - $field_options['truncatelink'] = array( |
|
52 | + $field_options[ 'truncatelink' ] = array( |
|
53 | 53 | 'type' => 'checkbox', |
54 | 54 | 'value' => true, |
55 | 55 | 'label' => __( 'Shorten Link Display', 'gravityview' ), |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * Set default to opening in new links for back-compatibility with Version 1.5.1 |
65 | 65 | * @link https://github.com/gravityview/GravityView/commit/e12e76e2d032754227728d41e65103042d4f75ec |
66 | 66 | */ |
67 | - $field_options['new_window']['value'] = true; |
|
68 | - $field_options['new_window']['priority'] = 2000; |
|
67 | + $field_options[ 'new_window' ][ 'value' ] = true; |
|
68 | + $field_options[ 'new_window' ][ 'priority' ] = 2000; |
|
69 | 69 | |
70 | 70 | return $field_options; |
71 | 71 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | function load() { |
26 | 26 | |
27 | - if( !is_admin() ) { |
|
27 | + if ( ! is_admin() ) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
39 | 39 | |
40 | 40 | // add tooltips |
41 | - add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips') ); |
|
41 | + add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips' ) ); |
|
42 | 42 | |
43 | 43 | // custom fields' options for zone EDIT |
44 | 44 | add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 6 ); |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | */ |
78 | 78 | function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
79 | 79 | |
80 | - if( $zone !== 'edit' ) { |
|
80 | + if ( $zone !== 'edit' ) { |
|
81 | 81 | |
82 | - $entry_default_fields['edit_link'] = array( |
|
83 | - 'label' => __('Link to Edit Entry', 'gravityview'), |
|
82 | + $entry_default_fields[ 'edit_link' ] = array( |
|
83 | + 'label' => __( 'Link to Edit Entry', 'gravityview' ), |
|
84 | 84 | 'type' => 'edit_link', |
85 | - 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
85 | + 'desc' => __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ), |
|
86 | 86 | 'icon' => 'dashicons-welcome-write-blog', |
87 | 87 | ); |
88 | 88 | |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | $caps = $visibility_caps; |
108 | 108 | |
109 | 109 | // If we're configuring fields in the edit context, we want a limited selection |
110 | - if( $context === 'edit' ) { |
|
110 | + if ( $context === 'edit' ) { |
|
111 | 111 | |
112 | 112 | // Remove other built-in caps. |
113 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
113 | + unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] ); |
|
114 | 114 | |
115 | - $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
115 | + $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | return $caps; |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
133 | 133 | |
134 | 134 | // Always a link, never a filter |
135 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
135 | + unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] ); |
|
136 | 136 | |
137 | 137 | // Edit Entry link should only appear to visitors capable of editing entries |
138 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
138 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
139 | 139 | |
140 | - $add_option['edit_link'] = array( |
|
140 | + $add_option[ 'edit_link' ] = array( |
|
141 | 141 | 'type' => 'text', |
142 | 142 | 'label' => __( 'Edit Link Text', 'gravityview' ), |
143 | 143 | 'desc' => NULL, |
144 | - 'value' => __('Edit Entry', 'gravityview'), |
|
144 | + 'value' => __( 'Edit Entry', 'gravityview' ), |
|
145 | 145 | 'merge_tags' => true, |
146 | 146 | ); |
147 | 147 | |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | |
158 | 158 | $return = $tooltips; |
159 | 159 | |
160 | - $return['allow_edit_cap'] = array( |
|
161 | - 'title' => __('Limiting Edit Access', 'gravityview'), |
|
162 | - 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
160 | + $return[ 'allow_edit_cap' ] = array( |
|
161 | + 'title' => __( 'Limiting Edit Access', 'gravityview' ), |
|
162 | + 'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ), |
|
163 | 163 | ); |
164 | 164 | |
165 | 165 | return $return; |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
181 | 181 | |
182 | 182 | // We only want to modify the settings for the edit context |
183 | - if( 'edit' !== $context ) { |
|
183 | + if ( 'edit' !== $context ) { |
|
184 | 184 | return $field_options; |
185 | 185 | } |
186 | 186 | |
187 | 187 | // Entry field is only for logged in users |
188 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
188 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
189 | 189 | |
190 | 190 | $add_options = array( |
191 | 191 | 'allow_edit_cap' => array( |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | if ( 'single' === $context ) { |
36 | - unset( $field_options['new_window'] ); |
|
36 | + unset( $field_options[ 'new_window' ] ); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $field_options; |
@@ -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 |