@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | function init() { |
22 | 22 | |
23 | 23 | $icon = is_admin() ? '<i class="icon gv-icon-astronaut-head"></i> ' : NULL; |
24 | - $this->title( $icon . __('GravityView', 'gravityview') ); |
|
24 | + $this->title( $icon . __( 'GravityView', 'gravityview' ) ); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | function get_warnings() { |
28 | 28 | |
29 | - if( is_null( $this->warnings ) ) { |
|
29 | + if ( is_null( $this->warnings ) ) { |
|
30 | 30 | $this->warnings = GravityView_Logging::get_errors(); |
31 | 31 | } |
32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | function get_notices() { |
37 | 37 | |
38 | - if( is_null( $this->notices ) ) { |
|
38 | + if ( is_null( $this->notices ) ) { |
|
39 | 39 | $this->notices = GravityView_Logging::get_notices(); |
40 | 40 | } |
41 | 41 | |
@@ -84,27 +84,27 @@ discard block |
||
84 | 84 | </style> |
85 | 85 | <div id='debug-bar-gravityview'>"; |
86 | 86 | |
87 | - $output .= '<img src="'.plugins_url('assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ).'" class="alignright" alt="" width="100" height="132" />'; |
|
87 | + $output .= '<img src="' . plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ) . '" class="alignright" alt="" width="100" height="132" />'; |
|
88 | 88 | |
89 | 89 | |
90 | 90 | $warnings = $this->get_warnings(); |
91 | 91 | $notices = $this->get_notices(); |
92 | 92 | |
93 | - if(count($warnings)) { |
|
94 | - $output .= '<h3><span>'.__('Warnings', 'gravityview').'</span></h3>'; |
|
93 | + if ( count( $warnings ) ) { |
|
94 | + $output .= '<h3><span>' . __( 'Warnings', 'gravityview' ) . '</span></h3>'; |
|
95 | 95 | $output .= '<ol>'; |
96 | - foreach ( $warnings as $key => $notice) { |
|
97 | - if(empty($notice['message'])) { continue; } |
|
98 | - $output .= '<li><a href="#'.sanitize_html_class( 'gv-warning-' . $key ).'">'.strip_tags($notice['message']).'</a></li>'; |
|
96 | + foreach ( $warnings as $key => $notice ) { |
|
97 | + if ( empty( $notice[ 'message' ] ) ) { continue; } |
|
98 | + $output .= '<li><a href="#' . sanitize_html_class( 'gv-warning-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>'; |
|
99 | 99 | } |
100 | 100 | $output .= '</ol><hr />'; |
101 | 101 | } |
102 | - if(count($notices)) { |
|
103 | - $output .= '<h3><span>'.__('Logs', 'gravityview').'</span></h3>'; |
|
102 | + if ( count( $notices ) ) { |
|
103 | + $output .= '<h3><span>' . __( 'Logs', 'gravityview' ) . '</span></h3>'; |
|
104 | 104 | $output .= '<ol>'; |
105 | - foreach ( $notices as $key => $notice) { |
|
106 | - if(empty($notice['message'])) { continue; } |
|
107 | - $output .= '<li><a href="#'.sanitize_html_class( 'gv-notice-' . $key ).'">'.strip_tags($notice['message']).'</a></li>'; |
|
105 | + foreach ( $notices as $key => $notice ) { |
|
106 | + if ( empty( $notice[ 'message' ] ) ) { continue; } |
|
107 | + $output .= '<li><a href="#' . sanitize_html_class( 'gv-notice-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>'; |
|
108 | 108 | } |
109 | 109 | $output .= '</ol><hr />'; |
110 | 110 | } |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | if ( count( $warnings ) ) { |
113 | 113 | $output .= '<h3>Warnings</h3>'; |
114 | 114 | $output .= '<ol class="debug-bar-php-list">'; |
115 | - foreach ( $warnings as $key => $notice) { $output .= $this->render_item( $notice, 'gv-warning-' . $key ); } |
|
115 | + foreach ( $warnings as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-warning-' . $key ); } |
|
116 | 116 | $output .= '</ol>'; |
117 | 117 | } |
118 | 118 | |
119 | 119 | if ( count( $notices ) ) { |
120 | 120 | $output .= '<h3>Notices</h3>'; |
121 | 121 | $output .= '<ol class="debug-bar-php-list">'; |
122 | - foreach ( $notices as $key => $notice) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); } |
|
122 | + foreach ( $notices as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); } |
|
123 | 123 | $output .= '</ol>'; |
124 | 124 | } |
125 | 125 | |
@@ -133,17 +133,17 @@ discard block |
||
133 | 133 | * @param string|array $item Unescaped |
134 | 134 | * @return string Escaped HTML |
135 | 135 | */ |
136 | - function esc_html_recursive($item) { |
|
137 | - if(is_object($item)) { |
|
138 | - foreach($item as $key => $value) { |
|
139 | - $item->{$key} = $this->esc_html_recursive($value); |
|
136 | + function esc_html_recursive( $item ) { |
|
137 | + if ( is_object( $item ) ) { |
|
138 | + foreach ( $item as $key => $value ) { |
|
139 | + $item->{$key} = $this->esc_html_recursive( $value ); |
|
140 | 140 | } |
141 | - } else if(is_array($item)) { |
|
142 | - foreach($item as $key => $value) { |
|
143 | - $item[$key] = $this->esc_html_recursive($value); |
|
141 | + } else if ( is_array( $item ) ) { |
|
142 | + foreach ( $item as $key => $value ) { |
|
143 | + $item[ $key ] = $this->esc_html_recursive( $value ); |
|
144 | 144 | } |
145 | 145 | } else { |
146 | - $item = esc_html($item); |
|
146 | + $item = esc_html( $item ); |
|
147 | 147 | } |
148 | 148 | return $item; |
149 | 149 | } |
@@ -159,26 +159,26 @@ discard block |
||
159 | 159 | |
160 | 160 | $output = ''; |
161 | 161 | |
162 | - if(!empty($notice['message'])) { |
|
163 | - $output .= '<a id="'.sanitize_html_class( $anchor ).'"></a>'; |
|
162 | + if ( ! empty( $notice[ 'message' ] ) ) { |
|
163 | + $output .= '<a id="' . sanitize_html_class( $anchor ) . '"></a>'; |
|
164 | 164 | $output .= "<li class='debug-bar-php-notice'>"; |
165 | 165 | } |
166 | 166 | |
167 | 167 | $output .= '<div class="clear"></div>'; |
168 | 168 | |
169 | 169 | // Title |
170 | - $output .= '<div class="gravityview-debug-bar-title">'.esc_attr( $notice['message'] ).'</div>'; |
|
170 | + $output .= '<div class="gravityview-debug-bar-title">' . esc_attr( $notice[ 'message' ] ) . '</div>'; |
|
171 | 171 | |
172 | 172 | // Debugging Output |
173 | - if( empty( $notice['data'] ) ) { |
|
174 | - if( !is_null( $notice['data'] ) ) { |
|
175 | - $output .= '<em>'._x('Empty', 'Debugging output data is empty.', 'gravityview' ).'</em>'; |
|
173 | + if ( empty( $notice[ 'data' ] ) ) { |
|
174 | + if ( ! is_null( $notice[ 'data' ] ) ) { |
|
175 | + $output .= '<em>' . _x( 'Empty', 'Debugging output data is empty.', 'gravityview' ) . '</em>'; |
|
176 | 176 | } |
177 | 177 | } else { |
178 | - $output .= sprintf( '<pre>%s</pre>', print_r($this->esc_html_recursive( $notice['data'] ), true) ); |
|
178 | + $output .= sprintf( '<pre>%s</pre>', print_r( $this->esc_html_recursive( $notice[ 'data' ] ), true ) ); |
|
179 | 179 | } |
180 | 180 | |
181 | - if(!empty($notice['message'])) { |
|
181 | + if ( ! empty( $notice[ 'message' ] ) ) { |
|
182 | 182 | $output .= '</li>'; |
183 | 183 | } |
184 | 184 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $wp_admin_bar->add_menu( array( |
63 | 63 | 'id' => 'edit-entry', |
64 | 64 | 'title' => __( 'Edit Entry', 'gravityview' ), |
65 | - 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry['form_id'], $entry['id'] ) ) ), |
|
65 | + 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry[ 'form_id' ], $entry[ 'id' ] ) ) ), |
|
66 | 66 | ) ); |
67 | 67 | |
68 | 68 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** @var WP_Admin_Bar $wp_admin_bar */ |
79 | 79 | global $wp_admin_bar; |
80 | 80 | |
81 | - if( GVCommon::has_cap('edit_gravityviews') ) { |
|
81 | + if ( GVCommon::has_cap( 'edit_gravityviews' ) ) { |
|
82 | 82 | |
83 | 83 | $view_data = GravityView_View_Data::getInstance(); |
84 | 84 | |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | if ( ! $this->gravityview_view->isGravityviewPostType() && ! empty( $views ) && ! $view_data->has_multiple_views() ) { |
90 | 90 | $view = reset( $views ); |
91 | 91 | |
92 | - if( GVCommon::has_cap( 'edit_gravityview', $view['id'] ) ) { |
|
92 | + if ( GVCommon::has_cap( 'edit_gravityview', $view[ 'id' ] ) ) { |
|
93 | 93 | $wp_admin_bar->add_menu( array( |
94 | 94 | 'id' => 'edit-view', |
95 | 95 | 'title' => __( 'Edit View', 'gravityview' ), |
96 | - 'href' => esc_url_raw( admin_url( sprintf( 'post.php?post=%d&action=edit', $view['id'] ) ) ), |
|
96 | + 'href' => esc_url_raw( admin_url( sprintf( 'post.php?post=%d&action=edit', $view[ 'id' ] ) ) ), |
|
97 | 97 | ) ); |
98 | 98 | } |
99 | 99 | } |
@@ -11,29 +11,29 @@ discard block |
||
11 | 11 | $field_info_items = array(); |
12 | 12 | |
13 | 13 | // Fields with IDs, not like Source URL or Entry ID |
14 | - if( is_numeric( $this->id ) ) { |
|
14 | + if ( is_numeric( $this->id ) ) { |
|
15 | 15 | |
16 | - $field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] ); |
|
16 | + $field_type_title = GFCommon::get_field_type_title( $this->item[ 'input_type' ] ); |
|
17 | 17 | |
18 | - $field_info_items[] = array( |
|
19 | - 'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title ) |
|
18 | + $field_info_items[ ] = array( |
|
19 | + 'value' => sprintf( __( 'Type: %s', 'gravityview' ), $field_type_title ) |
|
20 | 20 | ); |
21 | 21 | |
22 | - $field_info_items[] = array( |
|
23 | - 'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ), |
|
22 | + $field_info_items[ ] = array( |
|
23 | + 'value' => sprintf( __( 'Field ID: %s', 'gravityview' ), $this->id ), |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | } |
27 | 27 | |
28 | - if( !empty( $this->item['desc'] ) ) { |
|
29 | - $field_info_items[] = array( |
|
30 | - 'value' => $this->item['desc'] |
|
28 | + if ( ! empty( $this->item[ 'desc' ] ) ) { |
|
29 | + $field_info_items[ ] = array( |
|
30 | + 'value' => $this->item[ 'desc' ] |
|
31 | 31 | ); |
32 | 32 | } |
33 | 33 | |
34 | - if( !empty( $this->item['adminLabel'] ) ) { |
|
35 | - $field_info_items[] = array( |
|
36 | - 'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ), |
|
34 | + if ( ! empty( $this->item[ 'adminLabel' ] ) ) { |
|
35 | + $field_info_items[ ] = array( |
|
36 | + 'value' => sprintf( __( 'Admin Label: %s', 'gravityview' ), $this->item[ 'adminLabel' ] ), |
|
37 | 37 | 'class' => 'gv-sublabel' |
38 | 38 | ); |
39 | 39 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $field_info = ''; |
53 | 53 | $field_info_items = array(); |
54 | 54 | |
55 | - if( !empty( $this->item['description'] ) ) { |
|
55 | + if ( ! empty( $this->item[ 'description' ] ) ) { |
|
56 | 56 | |
57 | - $field_info_items[] = array( |
|
58 | - 'value' => $this->item['description'] |
|
57 | + $field_info_items[ ] = array( |
|
58 | + 'value' => $this->item[ 'description' ] |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | } |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | function __construct( $title = '', $field_id, $item = array(), $settings = array() ) { |
81 | 81 | |
82 | 82 | // Backward compat |
83 | - if( !empty( $item['type'] ) ) { |
|
84 | - $item['input_type'] = $item['type']; |
|
85 | - unset( $item['type'] ); |
|
83 | + if ( ! empty( $item[ 'type' ] ) ) { |
|
84 | + $item[ 'input_type' ] = $item[ 'type' ]; |
|
85 | + unset( $item[ 'type' ] ); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // Prevent items from not having index set |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | 'adminLabel' => NULL, |
97 | 97 | 'adminOnly' => NULL, |
98 | 98 | 'subtitle' => NULL, |
99 | - )); |
|
99 | + ) ); |
|
100 | 100 | |
101 | 101 | $this->title = $title; |
102 | 102 | $this->item = $item; |
103 | 103 | $this->id = $field_id; |
104 | 104 | $this->settings = $settings; |
105 | - $this->label_type = $item['label_type']; |
|
105 | + $this->label_type = $item[ 'label_type' ]; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | */ |
142 | 142 | $field_info_items = apply_filters( 'gravityview_admin_label_item_info', $field_info_items, $this ); |
143 | 143 | |
144 | - if( $html ) { |
|
144 | + if ( $html ) { |
|
145 | 145 | |
146 | 146 | foreach ( $field_info_items as $item ) { |
147 | - $class = isset($item['class']) ? sanitize_html_class( $item['class'] ).' description' : 'description'; |
|
147 | + $class = isset( $item[ 'class' ] ) ? sanitize_html_class( $item[ 'class' ] ) . ' description' : 'description'; |
|
148 | 148 | // Add the title in case the value's long, in which case, it'll be truncated by CSS. |
149 | - $output .= '<span class="'.$class.'">'; |
|
150 | - $output .= esc_html( $item['value'] ); |
|
149 | + $output .= '<span class="' . $class . '">'; |
|
150 | + $output .= esc_html( $item[ 'value' ] ); |
|
151 | 151 | $output .= '</span>'; |
152 | 152 | } |
153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $values = wp_list_pluck( $field_info_items, 'value' ); |
157 | 157 | |
158 | - $output = esc_html( implode(', ', $values) ); |
|
158 | + $output = esc_html( implode( ', ', $values ) ); |
|
159 | 159 | |
160 | 160 | } |
161 | 161 | |
@@ -170,53 +170,53 @@ discard block |
||
170 | 170 | */ |
171 | 171 | function getOutput() { |
172 | 172 | |
173 | - $settings_title = sprintf(__('Configure %s Settings', 'gravityview'), ucfirst($this->label_type)); |
|
174 | - $delete_title = sprintf(__('Remove %s', 'gravityview'), ucfirst($this->label_type)); |
|
175 | - $single_link_title = __('This field links to the Single Entry', 'gravityview'); |
|
173 | + $settings_title = sprintf( __( 'Configure %s Settings', 'gravityview' ), ucfirst( $this->label_type ) ); |
|
174 | + $delete_title = sprintf( __( 'Remove %s', 'gravityview' ), ucfirst( $this->label_type ) ); |
|
175 | + $single_link_title = __( 'This field links to the Single Entry', 'gravityview' ); |
|
176 | 176 | |
177 | 177 | // $settings_html will just be hidden inputs if empty. Otherwise, it'll have an <ul>. Ugly hack, I know. |
178 | 178 | // TODO: Un-hack this |
179 | - $hide_settings_link = ( empty( $this->item['settings_html'] ) || strpos( $this->item['settings_html'], '<!-- No Options -->') > 0 ) ? 'hide-if-js' : ''; |
|
179 | + $hide_settings_link = ( empty( $this->item[ 'settings_html' ] ) || strpos( $this->item[ 'settings_html' ], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : ''; |
|
180 | 180 | $settings_link = sprintf( '<a href="#settings" class="dashicons-admin-generic dashicons %s" title="%s"></a>', $hide_settings_link, esc_attr( $settings_title ) ); |
181 | 181 | |
182 | 182 | // Should we show the icon that the field is being used as a link to single entry? |
183 | - $hide_show_as_link_class = empty( $this->settings['show_as_link'] ) ? 'hide-if-js' : ''; |
|
184 | - $show_as_link = '<span class="dashicons dashicons-admin-links '.$hide_show_as_link_class.'" title="'.esc_attr( $single_link_title ).'"></span>'; |
|
183 | + $hide_show_as_link_class = empty( $this->settings[ 'show_as_link' ] ) ? 'hide-if-js' : ''; |
|
184 | + $show_as_link = '<span class="dashicons dashicons-admin-links ' . $hide_show_as_link_class . '" title="' . esc_attr( $single_link_title ) . '"></span>'; |
|
185 | 185 | |
186 | 186 | // When a field label is empty, use the Field ID |
187 | - $label = empty( $this->title ) ? sprintf( _x('Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview'), $this->id ) : $this->title; |
|
187 | + $label = empty( $this->title ) ? sprintf( _x( 'Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview' ), $this->id ) : $this->title; |
|
188 | 188 | |
189 | 189 | // If there's a custom label, and show label is checked, use that as the field heading |
190 | - if( !empty( $this->settings['custom_label'] ) && !empty( $this->settings['show_label'] ) ) { |
|
191 | - $label = $this->settings['custom_label']; |
|
192 | - } else if( !empty( $this->item['customLabel'] ) ) { |
|
193 | - $label = $this->item['customLabel']; |
|
190 | + if ( ! empty( $this->settings[ 'custom_label' ] ) && ! empty( $this->settings[ 'show_label' ] ) ) { |
|
191 | + $label = $this->settings[ 'custom_label' ]; |
|
192 | + } else if ( ! empty( $this->item[ 'customLabel' ] ) ) { |
|
193 | + $label = $this->item[ 'customLabel' ]; |
|
194 | 194 | } |
195 | 195 | |
196 | - $output = '<h5 class="selectable gfield field-id-'.esc_attr($this->id).'">'; |
|
196 | + $output = '<h5 class="selectable gfield field-id-' . esc_attr( $this->id ) . '">'; |
|
197 | 197 | |
198 | 198 | $label = esc_attr( $label ); |
199 | 199 | |
200 | - if( !empty( $this->item['parent'] ) ) { |
|
201 | - $label .= ' <small>('.esc_attr( $this->item['parent']['label'] ) .')</small>'; |
|
200 | + if ( ! empty( $this->item[ 'parent' ] ) ) { |
|
201 | + $label .= ' <small>(' . esc_attr( $this->item[ 'parent' ][ 'label' ] ) . ')</small>'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | // Name of field / widget |
205 | - $output .= '<span class="gv-field-label" data-original-title="'.esc_attr( $label ).'" title="'. $this->get_item_info( false ) .'">'. $label . '</span>'; |
|
205 | + $output .= '<span class="gv-field-label" data-original-title="' . esc_attr( $label ) . '" title="' . $this->get_item_info( false ) . '">' . $label . '</span>'; |
|
206 | 206 | |
207 | 207 | |
208 | - $output .= '<span class="gv-field-controls">'.$settings_link.$show_as_link.'<a href="#remove" class="dashicons-dismiss dashicons" title="'.esc_attr( $delete_title ) .'"></a></span>'; |
|
208 | + $output .= '<span class="gv-field-controls">' . $settings_link . $show_as_link . '<a href="#remove" class="dashicons-dismiss dashicons" title="' . esc_attr( $delete_title ) . '"></a></span>'; |
|
209 | 209 | |
210 | 210 | // Displays only in the field/widget picker. |
211 | - if( $field_info = $this->get_item_info() ) { |
|
212 | - $output .= '<span class="gv-field-info">'.$field_info.'</span>'; |
|
211 | + if ( $field_info = $this->get_item_info() ) { |
|
212 | + $output .= '<span class="gv-field-info">' . $field_info . '</span>'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | $output .= '</h5>'; |
216 | 216 | |
217 | - $container_class = !empty( $this->item['parent'] ) ? ' gv-child-field' : ''; |
|
217 | + $container_class = ! empty( $this->item[ 'parent' ] ) ? ' gv-child-field' : ''; |
|
218 | 218 | |
219 | - $output = '<div data-fieldid="'.esc_attr($this->id).'" data-inputtype="'.esc_attr( $this->item['input_type'] ).'" class="gv-fields'.$container_class.'">'.$output.$this->item['settings_html'].'</div>'; |
|
219 | + $output = '<div data-fieldid="' . esc_attr( $this->id ) . '" data-inputtype="' . esc_attr( $this->item[ 'input_type' ] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item[ 'settings_html' ] . '</div>'; |
|
220 | 220 | |
221 | 221 | return $output; |
222 | 222 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
29 | 29 | |
30 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
30 | + unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] ); |
|
31 | 31 | |
32 | 32 | return $field_options; |
33 | 33 | } |
@@ -28,17 +28,17 @@ |
||
28 | 28 | |
29 | 29 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
30 | 30 | |
31 | - $field_options['number_format'] = array( |
|
31 | + $field_options[ 'number_format' ] = array( |
|
32 | 32 | 'type' => 'checkbox', |
33 | 33 | 'label' => __( 'Format number?', 'gravityview' ), |
34 | - 'desc' => __('Display numbers with thousands separators.', 'gravityview'), |
|
34 | + 'desc' => __( 'Display numbers with thousands separators.', 'gravityview' ), |
|
35 | 35 | 'value' => false, |
36 | 36 | ); |
37 | 37 | |
38 | - $field_options['decimals'] = array( |
|
38 | + $field_options[ 'decimals' ] = array( |
|
39 | 39 | 'type' => 'number', |
40 | 40 | 'label' => __( 'Decimals', 'gravityview' ), |
41 | - 'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview'), |
|
41 | + 'desc' => __( 'Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview' ), |
|
42 | 42 | 'value' => '', |
43 | 43 | 'merge_tags' => false, |
44 | 44 | ); |
@@ -24,20 +24,20 @@ |
||
24 | 24 | function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
25 | 25 | |
26 | 26 | // If this is NOT the full address field, return default options. |
27 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
27 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
28 | 28 | return $field_options; |
29 | 29 | } |
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $add_options = array(); |
36 | 36 | |
37 | - $add_options['show_map_link'] = array( |
|
37 | + $add_options[ 'show_map_link' ] = array( |
|
38 | 38 | 'type' => 'checkbox', |
39 | 39 | 'label' => __( 'Show Map Link:', 'gravityview' ), |
40 | - 'desc' => __('Display a "Map It" link below the address', 'gravityview'), |
|
40 | + 'desc' => __( 'Display a "Map It" link below the address', 'gravityview' ), |
|
41 | 41 | 'value' => true, |
42 | 42 | 'merge_tags' => false, |
43 | 43 | ); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
31 | 31 | |
32 | - $this->add_field_support('link_to_post', $field_options ); |
|
32 | + $this->add_field_support( 'link_to_post', $field_options ); |
|
33 | 33 | |
34 | 34 | return $field_options; |
35 | 35 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function get_content( $output, $entry, $field_settings, $field ) { |
59 | 59 | |
60 | 60 | /** Overridden by a template. */ |
61 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
61 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
62 | 62 | |
63 | 63 | return $this->get_string_from_value( $output ); |
64 | 64 | } |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | switch ( intval( $value ) ) { |
78 | 78 | case self::NOT_FULFILLED: |
79 | 79 | default: |
80 | - $return = __('Not Fulfilled', 'gravityview'); |
|
80 | + $return = __( 'Not Fulfilled', 'gravityview' ); |
|
81 | 81 | break; |
82 | 82 | |
83 | 83 | case self::FULFILLED: |
84 | - $return = __('Fulfilled', 'gravityview'); |
|
84 | + $return = __( 'Fulfilled', 'gravityview' ); |
|
85 | 85 | break; |
86 | 86 | } |
87 | 87 | |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @return string Original text if {is_fulfilled} isn't found. Otherwise, "Not Fulfilled" or "Fulfilled" |
103 | 103 | */ |
104 | - public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
104 | + public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
105 | 105 | |
106 | 106 | $return = $text; |
107 | 107 | |
108 | 108 | foreach ( $matches as $match ) { |
109 | 109 | |
110 | - $full_tag = $match[0]; |
|
110 | + $full_tag = $match[ 0 ]; |
|
111 | 111 | |
112 | 112 | $fulfilled = rgar( $entry, 'is_fulfilled' ); |
113 | 113 |
@@ -25,13 +25,13 @@ |
||
25 | 25 | |
26 | 26 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
27 | 27 | |
28 | - if( 'edit' === $context ) { |
|
28 | + if ( 'edit' === $context ) { |
|
29 | 29 | return $field_options; |
30 | 30 | } |
31 | 31 | |
32 | - $this->add_field_support('link_to_post', $field_options ); |
|
32 | + $this->add_field_support( 'link_to_post', $field_options ); |
|
33 | 33 | |
34 | - $this->add_field_support('dynamic_data', $field_options ); |
|
34 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
35 | 35 | |
36 | 36 | return $field_options; |
37 | 37 | } |