@@ -291,7 +291,7 @@ |
||
| 291 | 291 | public function settings() { |
| 292 | 292 | |
| 293 | 293 | // If doing ajax, get outta here |
| 294 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
| 294 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
| 295 | 295 | return; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -79,8 +79,9 @@ |
||
| 79 | 79 | * Check permissions. |
| 80 | 80 | */ |
| 81 | 81 | while ( $error = $view->can_render( array( 'shortcode' ), $request ) ) { |
| 82 | - if ( ! is_wp_error( $error ) ) |
|
| 83 | - break; |
|
| 82 | + if ( ! is_wp_error( $error ) ) { |
|
| 83 | + break; |
|
| 84 | + } |
|
| 84 | 85 | |
| 85 | 86 | switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) { |
| 86 | 87 | case 'post_password_required': |
@@ -230,8 +230,9 @@ |
||
| 230 | 230 | * Check permissions. |
| 231 | 231 | */ |
| 232 | 232 | while ( $error = $view->can_render( null, $request ) ) { |
| 233 | - if ( ! is_wp_error( $error ) ) |
|
| 234 | - break; |
|
| 233 | + if ( ! is_wp_error( $error ) ) { |
|
| 234 | + break; |
|
| 235 | + } |
|
| 235 | 236 | |
| 236 | 237 | switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) { |
| 237 | 238 | case 'post_password_required': |
@@ -449,9 +449,7 @@ |
||
| 449 | 449 | $button_label = sprintf( __( 'Upgrade to %s for Access', 'gravityview' ), $required_license ); |
| 450 | 450 | $button_class = 'button-primary button-large'; |
| 451 | 451 | $href = 'https://gravityview.co/pricing/?utm_source=admin-installer&utm_medium=admin&utm_campaign=Admin%20Notice&utm_content=' . $required_license; |
| 452 | - } |
|
| 453 | - |
|
| 454 | - elseif ( ! empty( $download_info['coming_soon'] ) ) { |
|
| 452 | + } elseif ( ! empty( $download_info['coming_soon'] ) ) { |
|
| 455 | 453 | $spinner = false; |
| 456 | 454 | $status = 'notinstalled'; |
| 457 | 455 | $status_label = __( 'Coming Soon', 'gravityview' ); |
@@ -1380,7 +1380,7 @@ discard block |
||
| 1380 | 1380 | $placeholders['label_value:data-label'] = trim( esc_attr( strip_tags( str_replace( '> ', '>', $placeholders['label_value'] ) ) ) ); |
| 1381 | 1381 | $placeholders['label_value:esc_attr'] = esc_attr( $placeholders['label_value'] ); |
| 1382 | 1382 | |
| 1383 | - if ( empty( $placeholders['label'] ) && ! empty( $placeholders['label_value'] ) ){ |
|
| 1383 | + if ( empty( $placeholders['label'] ) && ! empty( $placeholders['label_value'] ) ) { |
|
| 1384 | 1384 | $placeholders['label'] = '<span class="gv-field-label">{{ label_value }}</span>'; |
| 1385 | 1385 | } |
| 1386 | 1386 | |
@@ -1419,7 +1419,7 @@ discard block |
||
| 1419 | 1419 | foreach ( $placeholders as $tag => $value ) { |
| 1420 | 1420 | |
| 1421 | 1421 | // If the tag doesn't exist just skip it |
| 1422 | - if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ){ |
|
| 1422 | + if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ) { |
|
| 1423 | 1423 | continue; |
| 1424 | 1424 | } |
| 1425 | 1425 | |
@@ -573,7 +573,8 @@ discard block |
||
| 573 | 573 | |
| 574 | 574 | // Only allow quantity to be set if it's allowed to be edited |
| 575 | 575 | if ( in_array( $field_id, $allowed_fields ) && $input_id == 3 ) { |
| 576 | - } else { // otherwise set to what it previously was |
|
| 576 | + } else { |
|
| 577 | +// otherwise set to what it previously was |
|
| 577 | 578 | $_POST[ $input_name ] = $entry[ $input['id'] ]; |
| 578 | 579 | } |
| 579 | 580 | } else { |
@@ -958,7 +959,7 @@ discard block |
||
| 958 | 959 | |
| 959 | 960 | $back_link = remove_query_arg( array( 'page', 'view', 'edit' ) ); |
| 960 | 961 | |
| 961 | - if( ! $this->is_valid ){ |
|
| 962 | + if( ! $this->is_valid ) { |
|
| 962 | 963 | |
| 963 | 964 | // Keeping this compatible with Gravity Forms. |
| 964 | 965 | $validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>"; |
@@ -2070,9 +2071,7 @@ discard block |
||
| 2070 | 2071 | // Verify |
| 2071 | 2072 | else if( ! $this->is_edit_entry() ) { |
| 2072 | 2073 | $valid = false; |
| 2073 | - } |
|
| 2074 | - |
|
| 2075 | - else { |
|
| 2074 | + } else { |
|
| 2076 | 2075 | $valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key ); |
| 2077 | 2076 | } |
| 2078 | 2077 | |
@@ -58,12 +58,14 @@ discard block |
||
| 58 | 58 | $value = $this->get_value( $atts ); |
| 59 | 59 | |
| 60 | 60 | if ( false === $operator && is_null( $value ) ) { |
| 61 | - if ( false !== $atts['if'] ) { // Only-if test |
|
| 61 | + if ( false !== $atts['if'] ) { |
|
| 62 | +// Only-if test |
|
| 62 | 63 | $match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) ); |
| 63 | 64 | } else { |
| 64 | 65 | $match = $authed; // Just login test |
| 65 | 66 | } |
| 66 | - } else { // Regular test |
|
| 67 | + } else { |
|
| 68 | +// Regular test |
|
| 67 | 69 | $match = $authed && \GVCommon::matches_operation( $atts['if'], $value, $operator ); |
| 68 | 70 | } |
| 69 | 71 | |
@@ -160,12 +162,15 @@ discard block |
||
| 160 | 162 | $opens = 0; // inner opens |
| 161 | 163 | $found = false; // found split position |
| 162 | 164 | |
| 163 | - while ( $content ) { // scan |
|
| 165 | + while ( $content ) { |
|
| 166 | +// scan |
|
| 164 | 167 | |
| 165 | 168 | if ( ! preg_match( '#(.*?)(\[\/?(gvlogic|else).*?])(.*)#s', $content, $matches ) ) { |
| 166 | - if ( ! $found ) { // We're still iffing. |
|
| 169 | + if ( ! $found ) { |
|
| 170 | +// We're still iffing. |
|
| 167 | 171 | $if .= $content; |
| 168 | - } else { // We are elsing |
|
| 172 | + } else { |
|
| 173 | +// We are elsing |
|
| 169 | 174 | $else .= $content; |
| 170 | 175 | } |
| 171 | 176 | break; // No more shortcodes |
@@ -173,9 +178,11 @@ discard block |
||
| 173 | 178 | |
| 174 | 179 | list( $_, $before_shortcode, $shortcode, $_, $after_shortcode ) = $matches; |
| 175 | 180 | |
| 176 | - if ( ! $found ) { // We're still iffing. |
|
| 181 | + if ( ! $found ) { |
|
| 182 | +// We're still iffing. |
|
| 177 | 183 | $if .= $before_shortcode; |
| 178 | - } else { // We are elsing |
|
| 184 | + } else { |
|
| 185 | +// We are elsing |
|
| 179 | 186 | $else .= $before_shortcode; |
| 180 | 187 | } |
| 181 | 188 | |
@@ -199,9 +206,11 @@ discard block |
||
| 199 | 206 | } |
| 200 | 207 | |
| 201 | 208 | // Tack on the shortcode |
| 202 | - if ( ! $found ) { // We're still iffing. |
|
| 209 | + if ( ! $found ) { |
|
| 210 | +// We're still iffing. |
|
| 203 | 211 | $if .= $shortcode; |
| 204 | - } else { // We are elsing |
|
| 212 | + } else { |
|
| 213 | +// We are elsing |
|
| 205 | 214 | $else .= $shortcode; |
| 206 | 215 | } |
| 207 | 216 | } |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | // WooCommerce doesn't $post_id |
| 454 | - if ( empty( $passed_post_id ) ) { |
|
| 454 | + if ( empty( $passed_post_id ) ) { |
|
| 455 | 455 | return $passed_title; |
| 456 | 456 | } |
| 457 | 457 | |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | */ |
| 1207 | 1207 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
| 1208 | 1208 | |
| 1209 | - switch( strtolower( $address_part ) ){ |
|
| 1209 | + switch( strtolower( $address_part ) ) { |
|
| 1210 | 1210 | case 'street': |
| 1211 | 1211 | $sort_field_id .= '.1'; |
| 1212 | 1212 | break; |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | */ |
| 1297 | 1297 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
| 1298 | 1298 | |
| 1299 | - if ( empty( $single_entry ) ){ |
|
| 1299 | + if ( empty( $single_entry ) ) { |
|
| 1300 | 1300 | return false; |
| 1301 | 1301 | } else { |
| 1302 | 1302 | return $single_entry; |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $entry = Multi_Entry::from_entries( array_filter( $multientry ) ); |
| 176 | - } else { |
|
| 176 | + } else { |
|
| 177 | 177 | /** |
| 178 | 178 | * A regular one. |
| 179 | 179 | */ |