@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 15 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * GravityView_Welcome Class |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @return string If a custom field label isn't set, return the field label for the password field |
| 51 | 51 | */ |
| 52 | - function field_label( $label = '', $field = array(), $form = array(), $entry = array() ){ |
|
| 52 | + function field_label( $label = '', $field = array(), $form = array(), $entry = array() ) { |
|
| 53 | 53 | |
| 54 | 54 | // If using a custom label, no need to fetch the parent label |
| 55 | 55 | if( ! is_numeric( $field['id'] ) || ! empty( $field['custom_label'] ) ) { |
@@ -36,8 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return void |
| 38 | 38 | */ |
| 39 | - public function emergency($message, array $context = array()) |
|
| 40 | - { |
|
| 39 | + public function emergency($message, array $context = array()) { |
|
| 41 | 40 | $this->log(LogLevel::EMERGENCY, $message, $context); |
| 42 | 41 | } |
| 43 | 42 | |
@@ -52,8 +51,7 @@ discard block |
||
| 52 | 51 | * |
| 53 | 52 | * @return void |
| 54 | 53 | */ |
| 55 | - public function alert($message, array $context = array()) |
|
| 56 | - { |
|
| 54 | + public function alert($message, array $context = array()) { |
|
| 57 | 55 | $this->log(LogLevel::ALERT, $message, $context); |
| 58 | 56 | } |
| 59 | 57 | |
@@ -67,8 +65,7 @@ discard block |
||
| 67 | 65 | * |
| 68 | 66 | * @return void |
| 69 | 67 | */ |
| 70 | - public function critical($message, array $context = array()) |
|
| 71 | - { |
|
| 68 | + public function critical($message, array $context = array()) { |
|
| 72 | 69 | $this->log(LogLevel::CRITICAL, $message, $context); |
| 73 | 70 | } |
| 74 | 71 | |
@@ -81,8 +78,7 @@ discard block |
||
| 81 | 78 | * |
| 82 | 79 | * @return void |
| 83 | 80 | */ |
| 84 | - public function error($message, array $context = array()) |
|
| 85 | - { |
|
| 81 | + public function error($message, array $context = array()) { |
|
| 86 | 82 | $this->log(LogLevel::ERROR, $message, $context); |
| 87 | 83 | } |
| 88 | 84 | |
@@ -97,8 +93,7 @@ discard block |
||
| 97 | 93 | * |
| 98 | 94 | * @return void |
| 99 | 95 | */ |
| 100 | - public function warning($message, array $context = array()) |
|
| 101 | - { |
|
| 96 | + public function warning($message, array $context = array()) { |
|
| 102 | 97 | $this->log(LogLevel::WARNING, $message, $context); |
| 103 | 98 | } |
| 104 | 99 | |
@@ -110,8 +105,7 @@ discard block |
||
| 110 | 105 | * |
| 111 | 106 | * @return void |
| 112 | 107 | */ |
| 113 | - public function notice($message, array $context = array()) |
|
| 114 | - { |
|
| 108 | + public function notice($message, array $context = array()) { |
|
| 115 | 109 | $this->log(LogLevel::NOTICE, $message, $context); |
| 116 | 110 | } |
| 117 | 111 | |
@@ -125,8 +119,7 @@ discard block |
||
| 125 | 119 | * |
| 126 | 120 | * @return void |
| 127 | 121 | */ |
| 128 | - public function info($message, array $context = array()) |
|
| 129 | - { |
|
| 122 | + public function info($message, array $context = array()) { |
|
| 130 | 123 | $this->log(LogLevel::INFO, $message, $context); |
| 131 | 124 | } |
| 132 | 125 | |
@@ -138,8 +131,7 @@ discard block |
||
| 138 | 131 | * |
| 139 | 132 | * @return void |
| 140 | 133 | */ |
| 141 | - public function debug($message, array $context = array()) |
|
| 142 | - { |
|
| 134 | + public function debug($message, array $context = array()) { |
|
| 143 | 135 | $this->log(LogLevel::DEBUG, $message, $context); |
| 144 | 136 | } |
| 145 | 137 | |
@@ -603,7 +603,8 @@ discard block |
||
| 603 | 603 | // Fast-forward 24 hour on the end time |
| 604 | 604 | $curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS ); |
| 605 | 605 | $search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end; |
| 606 | - if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056 |
|
| 606 | + if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { |
|
| 607 | +// See https://github.com/gravityview/GravityView/issues/1056 |
|
| 607 | 608 | $search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 ); |
| 608 | 609 | } |
| 609 | 610 | } |
@@ -874,7 +875,7 @@ discard block |
||
| 874 | 875 | 'ymd_dot' => 'Y.m.d', |
| 875 | 876 | ); |
| 876 | 877 | |
| 877 | - if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){ |
|
| 878 | + if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) { |
|
| 878 | 879 | $format = $datepicker[ $field->dateFormat ]; |
| 879 | 880 | } |
| 880 | 881 | |
@@ -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': |
@@ -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 | |
@@ -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 | */ |
@@ -61,14 +61,16 @@ discard block |
||
| 61 | 61 | $value = $this->get_value( $atts ); |
| 62 | 62 | |
| 63 | 63 | if ( false === $operator && is_null( $value ) ) { |
| 64 | - if ( false !== $atts['if'] ) { // Only-if test |
|
| 64 | + if ( false !== $atts['if'] ) { |
|
| 65 | +// Only-if test |
|
| 65 | 66 | $match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) ); |
| 66 | 67 | } else { |
| 67 | 68 | $match = $authed; // Just login test |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | $output = $this->get_output( $match, $atts, $content ); |
| 71 | - } else { // Regular test |
|
| 72 | + } else { |
|
| 73 | +// Regular test |
|
| 72 | 74 | |
| 73 | 75 | $output = $content; |
| 74 | 76 | |
@@ -199,12 +201,15 @@ discard block |
||
| 199 | 201 | $opens = 0; // inner opens |
| 200 | 202 | $found = false; // found split position |
| 201 | 203 | |
| 202 | - while ( $content ) { // scan |
|
| 204 | + while ( $content ) { |
|
| 205 | +// scan |
|
| 203 | 206 | |
| 204 | 207 | if ( ! preg_match( '#(.*?)(\[\/?(gvlogic|else).*?])(.*)#s', $content, $matches ) ) { |
| 205 | - if ( ! $found ) { // We're still iffing. |
|
| 208 | + if ( ! $found ) { |
|
| 209 | +// We're still iffing. |
|
| 206 | 210 | $if .= $content; |
| 207 | - } else { // We are elsing |
|
| 211 | + } else { |
|
| 212 | +// We are elsing |
|
| 208 | 213 | $else .= $content; |
| 209 | 214 | } |
| 210 | 215 | break; // No more shortcodes |
@@ -212,9 +217,11 @@ discard block |
||
| 212 | 217 | |
| 213 | 218 | list( $_, $before_shortcode, $shortcode, $_, $after_shortcode ) = $matches; |
| 214 | 219 | |
| 215 | - if ( ! $found ) { // We're still iffing. |
|
| 220 | + if ( ! $found ) { |
|
| 221 | +// We're still iffing. |
|
| 216 | 222 | $if .= $before_shortcode; |
| 217 | - } else { // We are elsing |
|
| 223 | + } else { |
|
| 224 | +// We are elsing |
|
| 218 | 225 | $else .= $before_shortcode; |
| 219 | 226 | } |
| 220 | 227 | |
@@ -238,9 +245,11 @@ discard block |
||
| 238 | 245 | } |
| 239 | 246 | |
| 240 | 247 | // Tack on the shortcode |
| 241 | - if ( ! $found ) { // We're still iffing. |
|
| 248 | + if ( ! $found ) { |
|
| 249 | +// We're still iffing. |
|
| 242 | 250 | $if .= $shortcode; |
| 243 | - } else { // We are elsing |
|
| 251 | + } else { |
|
| 252 | +// We are elsing |
|
| 244 | 253 | $else .= $shortcode; |
| 245 | 254 | } |
| 246 | 255 | } |