@@ -57,12 +57,14 @@ discard block |
||
| 57 | 57 | $value = $this->get_value( $atts ); |
| 58 | 58 | |
| 59 | 59 | if ( false === $operator && is_null( $value ) ) { |
| 60 | - if ( false !== $atts['if'] ) { // Only-if test |
|
| 60 | + if ( false !== $atts['if'] ) { |
|
| 61 | +// Only-if test |
|
| 61 | 62 | $match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) ); |
| 62 | 63 | } else { |
| 63 | 64 | $match = $authed; // Just login test |
| 64 | 65 | } |
| 65 | - } else { // Regular test |
|
| 66 | + } else { |
|
| 67 | +// Regular test |
|
| 66 | 68 | $match = $authed && \GVCommon::matches_operation( $atts['if'], $value, $operator ); |
| 67 | 69 | } |
| 68 | 70 | |
@@ -153,11 +155,14 @@ discard block |
||
| 153 | 155 | $opens = 0; // inner opens |
| 154 | 156 | $found = false; // found split position |
| 155 | 157 | |
| 156 | - while ( $content ) { // scan |
|
| 158 | + while ( $content ) { |
|
| 159 | +// scan |
|
| 157 | 160 | if ( ! preg_match( '#(.*?)(\[\/?(gvlogic|else).*?])(.*)#', $content, $matches ) ) { |
| 158 | - if ( ! $found ) { // We're still iffing. |
|
| 161 | + if ( ! $found ) { |
|
| 162 | +// We're still iffing. |
|
| 159 | 163 | $if .= $content; |
| 160 | - } else { // We are elsing |
|
| 164 | + } else { |
|
| 165 | +// We are elsing |
|
| 161 | 166 | $else .= $content; |
| 162 | 167 | } |
| 163 | 168 | break; // No more shortcodes |
@@ -165,9 +170,11 @@ discard block |
||
| 165 | 170 | |
| 166 | 171 | list( $_, $before_shortcode, $shortcode, $_, $after_shortcode ) = $matches; |
| 167 | 172 | |
| 168 | - if ( ! $found ) { // We're still iffing. |
|
| 173 | + if ( ! $found ) { |
|
| 174 | +// We're still iffing. |
|
| 169 | 175 | $if .= $before_shortcode; |
| 170 | - } else { // We are elsing |
|
| 176 | + } else { |
|
| 177 | +// We are elsing |
|
| 171 | 178 | $else .= $before_shortcode; |
| 172 | 179 | } |
| 173 | 180 | |
@@ -191,9 +198,11 @@ discard block |
||
| 191 | 198 | } |
| 192 | 199 | |
| 193 | 200 | // Tack on the shortcode |
| 194 | - if ( ! $found ) { // We're still iffing. |
|
| 201 | + if ( ! $found ) { |
|
| 202 | +// We're still iffing. |
|
| 195 | 203 | $if .= $shortcode; |
| 196 | - } else { // We are elsing |
|
| 204 | + } else { |
|
| 205 | +// We are elsing |
|
| 197 | 206 | $else .= $shortcode; |
| 198 | 207 | } |
| 199 | 208 | } |