@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $additional = array(); |
99 | 99 | |
100 | 100 | // form-19-table-body.php |
101 | - $additional[] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
101 | + $additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
102 | 102 | |
103 | 103 | // view-3-table-body.php |
104 | - $additional[] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
104 | + $additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
105 | 105 | |
106 | 106 | global $post; |
107 | 107 | if ( $post ) { |
108 | 108 | // page-19-table-body.php |
109 | - $additional[] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
109 | + $additional[ ] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Combine with existing table-body.php and table.php |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | ob_start(); |
131 | 131 | |
132 | 132 | $request = new Mock_Request(); |
133 | - $request->returns['is_view'] = $this->view; |
|
133 | + $request->returns[ 'is_view' ] = $this->view; |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * You got one shot. One opportunity. To render all the widgets you have ever wanted. |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | */ |
143 | 143 | global $wp_filter; |
144 | 144 | foreach ( array( 'gravityview_before', 'gravityview_after' ) as $hook ) { |
145 | - foreach ( $wp_filter[ $hook ]->callbacks[10] as $function_key => $callback ) { |
|
145 | + foreach ( $wp_filter[ $hook ]->callbacks[ 10 ] as $function_key => $callback ) { |
|
146 | 146 | if ( strpos( $function_key, 'render_widget_hooks' ) ) { |
147 | - unset( $wp_filter[ $hook ]->callbacks[10][ $function_key ] ); |
|
147 | + unset( $wp_filter[ $hook ]->callbacks[ 10 ][ $function_key ] ); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | if ( $this->entry ) { |
156 | 156 | |
157 | - $request->returns['is_entry'] = $this->entry; |
|
157 | + $request->returns[ 'is_entry' ] = $this->entry; |
|
158 | 158 | |
159 | 159 | global $post; |
160 | 160 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | * This allows us to fake it till we make it. |
189 | 189 | */ |
190 | 190 | $parameters = $this->view->settings->as_atts(); |
191 | - if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) { |
|
191 | + if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) { |
|
192 | 192 | $has_multisort = true; |
193 | - $parameters['sort_field'] = reset( $parameters['sort_field'] ); |
|
194 | - if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) { |
|
195 | - $parameters['sort_direction'] = reset( $parameters['sort_direction'] ); |
|
193 | + $parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] ); |
|
194 | + if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) { |
|
195 | + $parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] ); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | 'fields' => $this->view->fields->by_visible( $this->view ), |
212 | 212 | 'in_the_loop' => true, |
213 | 213 | ), empty( $parameters ) ? array() : array( |
214 | - 'paging' => $parameters['paging'], |
|
215 | - 'sorting' => $parameters['sorting'], |
|
214 | + 'paging' => $parameters[ 'paging' ], |
|
215 | + 'sorting' => $parameters[ 'sorting' ], |
|
216 | 216 | ), $post ? array( |
217 | 217 | 'post' => $post, |
218 | 218 | ) : array() ) ); |
@@ -60,21 +60,21 @@ discard block |
||
60 | 60 | public function dismiss_notice() { |
61 | 61 | |
62 | 62 | // No dismiss sent |
63 | - if( empty( $_GET['gv-dismiss'] ) || empty( $_GET['notice'] ) ) { |
|
63 | + if ( empty( $_GET[ 'gv-dismiss' ] ) || empty( $_GET[ 'notice' ] ) ) { |
|
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | 67 | // Invalid nonce |
68 | - if( !wp_verify_nonce( $_GET['gv-dismiss'], 'dismiss' ) ) { |
|
68 | + if ( ! wp_verify_nonce( $_GET[ 'gv-dismiss' ], 'dismiss' ) ) { |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
72 | - $notice_id = esc_attr( $_GET['notice'] ); |
|
72 | + $notice_id = esc_attr( $_GET[ 'notice' ] ); |
|
73 | 73 | |
74 | 74 | //don't display a message if use has dismissed the message for this version |
75 | 75 | $dismissed_notices = (array)get_transient( 'gravityview_dismissed_notices' ); |
76 | 76 | |
77 | - $dismissed_notices[] = $notice_id; |
|
77 | + $dismissed_notices[ ] = $notice_id; |
|
78 | 78 | |
79 | 79 | $dismissed_notices = array_unique( $dismissed_notices ); |
80 | 80 | |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | private function is_notice_dismissed( $notice ) { |
98 | 98 | |
99 | 99 | // There are no dismissed notices. |
100 | - if( empty( self::$dismissed_notices ) ) { |
|
100 | + if ( empty( self::$dismissed_notices ) ) { |
|
101 | 101 | return false; |
102 | 102 | } |
103 | 103 | |
104 | 104 | // Has the |
105 | - $is_dismissed = !empty( $notice['dismiss'] ) && in_array( $notice['dismiss'], self::$dismissed_notices ); |
|
105 | + $is_dismissed = ! empty( $notice[ 'dismiss' ] ) && in_array( $notice[ 'dismiss' ], self::$dismissed_notices ); |
|
106 | 106 | |
107 | 107 | return $is_dismissed ? true : false; |
108 | 108 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | private function check_show_multisite_notices() { |
129 | 129 | |
130 | - if( ! is_multisite() ) { |
|
130 | + if ( ! is_multisite() ) { |
|
131 | 131 | return true; |
132 | 132 | } |
133 | 133 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | // or they don't have admin capabilities |
140 | - if( ! is_super_admin() ) { |
|
140 | + if ( ! is_super_admin() ) { |
|
141 | 141 | return false; |
142 | 142 | } |
143 | 143 | |
@@ -160,48 +160,48 @@ discard block |
||
160 | 160 | */ |
161 | 161 | $notices = apply_filters( 'gravityview/admin/notices', self::$admin_notices ); |
162 | 162 | |
163 | - if( empty( $notices ) || ! $this->check_show_multisite_notices() ) { |
|
163 | + if ( empty( $notices ) || ! $this->check_show_multisite_notices() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
167 | 167 | //don't display a message if use has dismissed the message for this version |
168 | 168 | // TODO: Use get_user_meta instead of get_transient |
169 | - self::$dismissed_notices = isset( $_GET['show-dismissed-notices'] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' ); |
|
169 | + self::$dismissed_notices = isset( $_GET[ 'show-dismissed-notices' ] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' ); |
|
170 | 170 | |
171 | 171 | $output = ''; |
172 | 172 | |
173 | - foreach( $notices as $notice ) { |
|
173 | + foreach ( $notices as $notice ) { |
|
174 | 174 | |
175 | 175 | // If the user doesn't have the capability to see the warning |
176 | - if( isset( $notice['cap'] ) && false === GVCommon::has_cap( $notice['cap'] ) ) { |
|
176 | + if ( isset( $notice[ 'cap' ] ) && false === GVCommon::has_cap( $notice[ 'cap' ] ) ) { |
|
177 | 177 | gravityview()->log->debug( 'Notice not shown because user does not have the capability to view it.', array( 'data' => $notice ) ); |
178 | 178 | continue; |
179 | 179 | } |
180 | 180 | |
181 | - if( true === $this->is_notice_dismissed( $notice ) ) { |
|
181 | + if ( true === $this->is_notice_dismissed( $notice ) ) { |
|
182 | 182 | gravityview()->log->debug( 'Notice not shown because the notice has already been dismissed.', array( 'data' => $notice ) ); |
183 | 183 | continue; |
184 | 184 | } |
185 | 185 | |
186 | - $output .= '<div id="message" style="position:relative" class="notice '. gravityview_sanitize_html_class( $notice['class'] ).'">'; |
|
186 | + $output .= '<div id="message" style="position:relative" class="notice ' . gravityview_sanitize_html_class( $notice[ 'class' ] ) . '">'; |
|
187 | 187 | |
188 | 188 | // Too cute to leave out. |
189 | 189 | $output .= gravityview_get_floaty(); |
190 | 190 | |
191 | - if( !empty( $notice['title'] ) ) { |
|
192 | - $output .= '<h3>'.esc_html( $notice['title'] ) .'</h3>'; |
|
191 | + if ( ! empty( $notice[ 'title' ] ) ) { |
|
192 | + $output .= '<h3>' . esc_html( $notice[ 'title' ] ) . '</h3>'; |
|
193 | 193 | } |
194 | 194 | |
195 | - $message = isset( $notice['message'] ) ? $notice['message'] : ''; |
|
195 | + $message = isset( $notice[ 'message' ] ) ? $notice[ 'message' ] : ''; |
|
196 | 196 | |
197 | - if( !empty( $notice['dismiss'] ) ) { |
|
197 | + if ( ! empty( $notice[ 'dismiss' ] ) ) { |
|
198 | 198 | |
199 | - $dismiss = esc_attr($notice['dismiss']); |
|
199 | + $dismiss = esc_attr( $notice[ 'dismiss' ] ); |
|
200 | 200 | |
201 | 201 | $url = esc_url( add_query_arg( array( 'gv-dismiss' => wp_create_nonce( 'dismiss' ), 'notice' => $dismiss ) ) ); |
202 | 202 | |
203 | 203 | $align = is_rtl() ? 'alignleft' : 'alignright'; |
204 | - $message .= '<a href="'.$url.'" data-notice="'.$dismiss.'" class="' . $align . ' button button-link">'.esc_html__('Dismiss', 'gravityview' ).'</a></p>'; |
|
204 | + $message .= '<a href="' . $url . '" data-notice="' . $dismiss . '" class="' . $align . ' button button-link">' . esc_html__( 'Dismiss', 'gravityview' ) . '</a></p>'; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $output .= wpautop( $message ); |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public static function add_notice( $notice = array() ) { |
235 | 235 | |
236 | - if( !isset( $notice['message'] ) ) { |
|
236 | + if ( ! isset( $notice[ 'message' ] ) ) { |
|
237 | 237 | gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) ); |
238 | 238 | return; |
239 | 239 | } |
240 | 240 | |
241 | - $notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class']; |
|
241 | + $notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ]; |
|
242 | 242 | |
243 | - self::$admin_notices[] = $notice; |
|
243 | + self::$admin_notices[ ] = $notice; |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $current_user = wp_get_current_user(); |
82 | 82 | $user_meta_key = '_gv_dismissed_entry_approval_notice' . $gravityview->view->ID; |
83 | 83 | |
84 | - if ( isset( $_GET['gv-dismiss'] ) && wp_verify_nonce( $_GET['gv-dismiss'], 'dismiss' ) ) { |
|
84 | + if ( isset( $_GET[ 'gv-dismiss' ] ) && wp_verify_nonce( $_GET[ 'gv-dismiss' ], 'dismiss' ) ) { |
|
85 | 85 | add_user_meta( $current_user->ID, $user_meta_key, 1 ); // Prevent user from seeing this again for this View |
86 | 86 | return; |
87 | 87 | } |
@@ -150,8 +150,7 @@ discard block |
||
150 | 150 | $tab = __( 'Edit Entry', 'gravityview' ); |
151 | 151 | $context = 'edit'; |
152 | 152 | break; |
153 | - case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ): |
|
154 | - $tab = __( 'Single Entry', 'gravityview' ); |
|
153 | + case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ) : $tab = __( 'Single Entry', 'gravityview' ); |
|
155 | 154 | $context = 'single'; |
156 | 155 | break; |
157 | 156 | default: |
@@ -173,7 +172,7 @@ discard block |
||
173 | 172 | $action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab ); |
174 | 173 | $message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' ); |
175 | 174 | |
176 | - $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
175 | + $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
177 | 176 | $output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message ); |
178 | 177 | |
179 | 178 | echo \GVCommon::generate_notice( $output . $image, 'gv-warning warning', 'edit_gravityview', $gravityview->view->ID ); |
@@ -199,11 +198,11 @@ discard block |
||
199 | 198 | |
200 | 199 | $post_types = get_post_types(); |
201 | 200 | |
202 | - foreach( $post_types as $post_type ) { |
|
201 | + foreach ( $post_types as $post_type ) { |
|
203 | 202 | $post_type_rewrite = get_post_type_object( $post_type )->rewrite; |
204 | 203 | |
205 | 204 | if ( $slug = \GV\Utils::get( $post_type_rewrite, 'slug' ) ) { |
206 | - $reserved_slugs[] = $slug; |
|
205 | + $reserved_slugs[ ] = $slug; |
|
207 | 206 | } |
208 | 207 | } |
209 | 208 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->label = esc_html__( 'Number Sequence', 'gravityview' ); |
42 | 42 | $this->description = esc_html__( 'Display a sequential result number for each entry.', 'gravityview' ); |
43 | 43 | |
44 | - add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'field_tooltips') ); |
|
44 | + add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'field_tooltips' ) ); |
|
45 | 45 | |
46 | 46 | add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 ); |
47 | 47 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return $entry_default_fields; |
66 | 66 | } |
67 | 67 | |
68 | - $entry_default_fields['sequence'] = array( |
|
68 | + $entry_default_fields[ 'sequence' ] = array( |
|
69 | 69 | 'label' => __( 'Result Number', 'gravityview' ), |
70 | 70 | 'type' => $this->name, |
71 | 71 | 'desc' => $this->description, |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | |
85 | 85 | $return = $tooltips; |
86 | 86 | |
87 | - $return['reverse_sequence'] = array( |
|
88 | - 'title' => __('Reverse the order of the result numbers', 'gravityview'), |
|
89 | - 'value' => __('Output the number sequence in descending order. If enabled, numbers will count down from high to low.', 'gravityview'), |
|
87 | + $return[ 'reverse_sequence' ] = array( |
|
88 | + 'title' => __( 'Reverse the order of the result numbers', 'gravityview' ), |
|
89 | + 'value' => __( 'Output the number sequence in descending order. If enabled, numbers will count down from high to low.', 'gravityview' ), |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | return $return; |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | |
95 | 95 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
96 | 96 | |
97 | - unset ( $field_options['search_filter'] ); |
|
97 | + unset ( $field_options[ 'search_filter' ] ); |
|
98 | 98 | |
99 | 99 | $new_fields = array( |
100 | 100 | 'start' => array( |
101 | 101 | 'type' => 'number', |
102 | 102 | 'label' => __( 'First Number in the Sequence', 'gravityview' ), |
103 | - 'desc' => __('For each entry, the displayed number will increase by one. When displaying ten entries, the first entry will display "1", and the last entry will show "10".', 'gravityview'), |
|
103 | + 'desc' => __( 'For each entry, the displayed number will increase by one. When displaying ten entries, the first entry will display "1", and the last entry will show "10".', 'gravityview' ), |
|
104 | 104 | 'value' => '1', |
105 | 105 | 'merge_tags' => false, |
106 | 106 | ), |
@@ -156,17 +156,17 @@ discard block |
||
156 | 156 | $return = $text; |
157 | 157 | |
158 | 158 | $context = new \GV\Template_Context(); |
159 | - $context->view = \GV\View::by_id( $view_data['view_id'] ); |
|
159 | + $context->view = \GV\View::by_id( $view_data[ 'view_id' ] ); |
|
160 | 160 | $context->entry = \GV\GF_Entry::from_entry( $entry ); |
161 | 161 | |
162 | 162 | $gv_field = \GV\Internal_Field::by_id( 'sequence' ); |
163 | 163 | $merge_tag_context = \GV\Utils::get( $legacy_field, 'UID' ); |
164 | - $merge_tag_context = $entry['id'] . "/{$merge_tag_context}"; |
|
164 | + $merge_tag_context = $entry[ 'id' ] . "/{$merge_tag_context}"; |
|
165 | 165 | |
166 | 166 | foreach ( $matches as $match ) { |
167 | 167 | |
168 | - $full_tag = $match[0]; |
|
169 | - $property = $match[1]; |
|
168 | + $full_tag = $match[ 0 ]; |
|
169 | + $property = $match[ 1 ]; |
|
170 | 170 | |
171 | 171 | $gv_field->reverse = false; |
172 | 172 | $gv_field->start = 1; |
@@ -185,12 +185,12 @@ discard block |
||
185 | 185 | |
186 | 186 | // If there is a field with the ID of the start number, the merge tag won't work. |
187 | 187 | // In that case, you can use "=" instead: `{sequence start=10}` |
188 | - if( 1 === sizeof( $maybe_start ) ) { |
|
188 | + if ( 1 === sizeof( $maybe_start ) ) { |
|
189 | 189 | $maybe_start = explode( '=', $modifier ); |
190 | 190 | } |
191 | 191 | |
192 | 192 | if ( 'start' === rgar( $maybe_start, 0 ) && is_numeric( rgar( $maybe_start, 1 ) ) ) { |
193 | - $gv_field->start = (int) rgar( $maybe_start, 1 ); |
|
193 | + $gv_field->start = (int)rgar( $maybe_start, 1 ); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $merge_tag_context_modifiers = $merge_tag_context . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start; |
202 | 202 | |
203 | 203 | if ( ! isset( $merge_tag_sequences[ $merge_tag_context_modifiers ] ) ) { |
204 | - $gv_field->UID = $legacy_field['UID'] . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start; |
|
204 | + $gv_field->UID = $legacy_field[ 'UID' ] . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start; |
|
205 | 205 | $context->field = $gv_field; |
206 | 206 | $sequence = $merge_tag_sequences[ $merge_tag_context_modifiers ] = $this->get_sequence( $context ); |
207 | 207 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $total = $context->view->get_entries()->total(); |
247 | 247 | remove_filter( 'gform_gf_query_sql', $callback ); |
248 | 248 | |
249 | - unset( $sql_query['paginate'] ); |
|
249 | + unset( $sql_query[ 'paginate' ] ); |
|
250 | 250 | |
251 | 251 | global $wpdb; |
252 | 252 |
@@ -97,13 +97,13 @@ |
||
97 | 97 | // Set the $_field_id var |
98 | 98 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ); |
99 | 99 | |
100 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
100 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
101 | 101 | $default = 'tick'; |
102 | 102 | } else { |
103 | 103 | $default = 'both'; |
104 | 104 | } |
105 | 105 | |
106 | - $field_options['choice_display'] = array( |
|
106 | + $field_options[ 'choice_display' ] = array( |
|
107 | 107 | 'type' => 'radio', |
108 | 108 | 'class' => 'vertical', |
109 | 109 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -14,42 +14,42 @@ |
||
14 | 14 | |
15 | 15 | $field_info_items = array(); |
16 | 16 | |
17 | - if( !empty( $this->item['adminLabel'] ) ) { |
|
18 | - $field_info_items[] = array( |
|
19 | - 'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ), |
|
17 | + if ( ! empty( $this->item[ 'adminLabel' ] ) ) { |
|
18 | + $field_info_items[ ] = array( |
|
19 | + 'value' => sprintf( __( 'Admin Label: %s', 'gravityview' ), $this->item[ 'adminLabel' ] ), |
|
20 | 20 | 'class' => 'gv-sublabel' |
21 | 21 | ); |
22 | 22 | } |
23 | 23 | |
24 | 24 | // Fields with IDs, not like Source URL or Entry ID |
25 | - if( is_numeric( $this->id ) ) { |
|
25 | + if ( is_numeric( $this->id ) ) { |
|
26 | 26 | |
27 | - $field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] ); |
|
27 | + $field_type_title = GFCommon::get_field_type_title( $this->item[ 'input_type' ] ); |
|
28 | 28 | |
29 | - if ( ! empty( $this->item['parent'] ) ) { |
|
30 | - $field_info_items[] = array( |
|
31 | - 'value' => sprintf( esc_html__( 'Parent: %s', 'gravityview' ), esc_attr( $this->item['parent']['label'] ) ), |
|
29 | + if ( ! empty( $this->item[ 'parent' ] ) ) { |
|
30 | + $field_info_items[ ] = array( |
|
31 | + 'value' => sprintf( esc_html__( 'Parent: %s', 'gravityview' ), esc_attr( $this->item[ 'parent' ][ 'label' ] ) ), |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 | |
35 | - $field_info_items[] = array( |
|
36 | - 'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title ), |
|
37 | - 'hide_in_picker' => ! empty( $this->item['parent'] ), |
|
35 | + $field_info_items[ ] = array( |
|
36 | + 'value' => sprintf( __( 'Type: %s', 'gravityview' ), $field_type_title ), |
|
37 | + 'hide_in_picker' => ! empty( $this->item[ 'parent' ] ), |
|
38 | 38 | ); |
39 | 39 | |
40 | - $field_info_items[] = array( |
|
41 | - 'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ), |
|
40 | + $field_info_items[ ] = array( |
|
41 | + 'value' => sprintf( __( 'Field ID: %s', 'gravityview' ), $this->id ), |
|
42 | 42 | ); |
43 | 43 | } |
44 | 44 | |
45 | - if( !empty( $this->item['desc'] ) ) { |
|
46 | - $field_info_items[] = array( |
|
47 | - 'value' => $this->item['desc'] |
|
45 | + if ( ! empty( $this->item[ 'desc' ] ) ) { |
|
46 | + $field_info_items[ ] = array( |
|
47 | + 'value' => $this->item[ 'desc' ] |
|
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | - $field_info_items[] = array( |
|
52 | - 'value' => sprintf( __('Form ID: %s', 'gravityview' ), $this->form_id ), |
|
51 | + $field_info_items[ ] = array( |
|
52 | + 'value' => sprintf( __( 'Form ID: %s', 'gravityview' ), $this->form_id ), |
|
53 | 53 | 'hide_in_picker' => true, |
54 | 54 | ); |
55 | 55 |
@@ -29,24 +29,24 @@ |
||
29 | 29 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
30 | 30 | |
31 | 31 | // Don't link to entry; doesn't make sense. |
32 | - unset( $field_options['show_as_link'] ); |
|
32 | + unset( $field_options[ 'show_as_link' ] ); |
|
33 | 33 | |
34 | - if( 'edit' === $context ) { |
|
34 | + if ( 'edit' === $context ) { |
|
35 | 35 | return $field_options; |
36 | 36 | } |
37 | 37 | |
38 | 38 | $add_options = array(); |
39 | - $add_options['link_to_source'] = array( |
|
39 | + $add_options[ 'link_to_source' ] = array( |
|
40 | 40 | 'type' => 'checkbox', |
41 | 41 | 'label' => __( 'Link to URL:', 'gravityview' ), |
42 | - 'desc' => __('Display as a link to the Source URL', 'gravityview'), |
|
42 | + 'desc' => __( 'Display as a link to the Source URL', 'gravityview' ), |
|
43 | 43 | 'value' => false, |
44 | 44 | 'merge_tags' => false, |
45 | 45 | ); |
46 | - $add_options['source_link_text'] = array( |
|
46 | + $add_options[ 'source_link_text' ] = array( |
|
47 | 47 | 'type' => 'text', |
48 | 48 | 'label' => __( 'Link Text:', 'gravityview' ), |
49 | - 'desc' => __('Customize the link text. If empty, the link text will be the URL.', 'gravityview'), |
|
49 | + 'desc' => __( 'Customize the link text. If empty, the link text will be the URL.', 'gravityview' ), |
|
50 | 50 | 'value' => NULL, |
51 | 51 | 'merge_tags' => true, |
52 | 52 | 'requires' => 'link_to_source', |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | static public function get_email( $field_settings, $entry ) { |
75 | 75 | |
76 | 76 | // There was no logged in user. |
77 | - switch ( $field_settings['email_field'] ) { |
|
77 | + switch ( $field_settings[ 'email_field' ] ) { |
|
78 | 78 | case 'created_by_email': |
79 | 79 | |
80 | 80 | $created_by = \GV\Utils::get( $entry, 'created_by', null ); |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | return $field_options; |
106 | 106 | } |
107 | 107 | |
108 | - unset( $field_options['new_window'] ); |
|
108 | + unset( $field_options[ 'new_window' ] ); |
|
109 | 109 | |
110 | - $field_options['email_field'] = array( |
|
110 | + $field_options[ 'email_field' ] = array( |
|
111 | 111 | 'type' => 'select', |
112 | 112 | 'label' => __( 'Email to Use', 'gravityview' ), |
113 | 113 | 'value' => 'created_by_email', |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'group' => 'display', |
117 | 117 | ); |
118 | 118 | |
119 | - $field_options['default'] = array( |
|
119 | + $field_options[ 'default' ] = array( |
|
120 | 120 | 'type' => 'select', |
121 | 121 | 'label' => __( 'Default Image', 'gravityview' ), |
122 | 122 | 'desc' => __( 'Choose the default image to be shown when an email has no Gravatar.', 'gravityview' ) . ' <a href="https://en.gravatar.com/site/implement/images/">' . esc_html( sprintf( __( 'Read more about %s', 'gravityview' ), __( 'Default Image', 'gravityview' ) ) ) . '</a>', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'group' => 'display', |
134 | 134 | ); |
135 | 135 | |
136 | - $field_options['size'] = array( |
|
136 | + $field_options[ 'size' ] = array( |
|
137 | 137 | 'type' => 'number', |
138 | 138 | 'label' => __( 'Size in Pixels', 'gravityview' ), |
139 | 139 | 'value' => 80, |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $email_fields = GFAPI::get_fields_by_type( $form, array( 'email' ) ); |
169 | 169 | |
170 | 170 | foreach ( $email_fields as $email_field ) { |
171 | - $email_field_id = $email_field['id']; |
|
171 | + $email_field_id = $email_field[ 'id' ]; |
|
172 | 172 | $email_field_label = GVCommon::get_field_label( $form, $email_field_id ); |
173 | 173 | $email_field_label = sprintf( __( 'Field: %s', 'gravityview' ), $email_field_label ); |
174 | 174 | $field_choices[ $email_field_id ] = esc_html( $email_field_label ); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | var $is_searchable = true; |
13 | 13 | |
14 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
14 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
15 | 15 | |
16 | 16 | var $_gf_field_class_name = 'GF_Field_Post_Category'; |
17 | 17 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $entry = GFAPI::get_entry( $entry_id ); |
47 | 47 | $post_id = \GV\Utils::get( $entry, 'post_id' ); |
48 | 48 | |
49 | - if( empty( $post_id ) ) { |
|
49 | + if ( empty( $post_id ) ) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | $post_category_fields = GFAPI::get_fields_by_type( $form, 'post_category' ); |
56 | 56 | |
57 | - if( $post_category_fields ) { |
|
57 | + if ( $post_category_fields ) { |
|
58 | 58 | |
59 | 59 | $updated_categories = array(); |
60 | 60 | |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return mixed |
123 | 123 | */ |
124 | - function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
124 | + function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
125 | 125 | |
126 | - $entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry(); |
|
126 | + $entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry(); |
|
127 | 127 | |
128 | 128 | // $entry['post_id'] should always be set, but we check to make sure. |
129 | - if( $entry && isset( $entry['post_id'] ) && $post_id = $entry['post_id'] ) { |
|
129 | + if ( $entry && isset( $entry[ 'post_id' ] ) && $post_id = $entry[ 'post_id' ] ) { |
|
130 | 130 | |
131 | 131 | $post_categories = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) ); |
132 | 132 | |
133 | 133 | // Always use the live value |
134 | 134 | foreach ( $choices as &$choice ) { |
135 | - $choice['isSelected'] = in_array( $choice['value'], array_values( $post_categories ) ); |
|
135 | + $choice[ 'isSelected' ] = in_array( $choice[ 'value' ], array_values( $post_categories ) ); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | |
142 | 142 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
143 | 143 | |
144 | - if( 'edit' === $context ) { |
|
144 | + if ( 'edit' === $context ) { |
|
145 | 145 | return $field_options; |
146 | 146 | } |
147 | 147 | |
148 | - $this->add_field_support('dynamic_data', $field_options ); |
|
149 | - $this->add_field_support('link_to_term', $field_options ); |
|
150 | - $this->add_field_support('new_window', $field_options ); |
|
148 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
149 | + $this->add_field_support( 'link_to_term', $field_options ); |
|
150 | + $this->add_field_support( 'new_window', $field_options ); |
|
151 | 151 | |
152 | - $field_options['new_window']['requires'] = 'link_to_term'; |
|
152 | + $field_options[ 'new_window' ][ 'requires' ] = 'link_to_term'; |
|
153 | 153 | |
154 | 154 | return $field_options; |
155 | 155 | } |