@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public static function process_modifiers( $value, $merge_tag, $modifier, $field, $raw_value ) { |
| 46 | 46 | |
| 47 | 47 | // No modifier was set or the raw value was empty |
| 48 | - if( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
| 48 | + if ( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) { |
|
| 49 | 49 | return $value; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | foreach ( $gv_modifiers as $gv_modifier => $method ) { |
| 62 | 62 | |
| 63 | 63 | // Only match the regex if it's the first modifer; this allows us to enforce our own modifier structure |
| 64 | - preg_match( '/^' . $gv_modifier .'/ism', $modifier, $matches ); |
|
| 64 | + preg_match( '/^' . $gv_modifier . '/ism', $modifier, $matches ); |
|
| 65 | 65 | |
| 66 | - if( ! empty( $matches ) ) { |
|
| 66 | + if ( ! empty( $matches ) ) { |
|
| 67 | 67 | // The called method is passed the raw value and the full matches array |
| 68 | 68 | $return = self::$method( $raw_value, $matches ); |
| 69 | 69 | break; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | private static function modifier_timestamp( $raw_value, $matches ) { |
| 89 | 89 | |
| 90 | - if( empty( $matches[0] ) ) { |
|
| 90 | + if ( empty( $matches[ 0 ] ) ) { |
|
| 91 | 91 | return $raw_value; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | private static function modifier_wpautop( $raw_value, $matches ) { |
| 113 | 113 | |
| 114 | - if( empty( $matches[0] ) || ! function_exists( 'wpautop' ) ) { |
|
| 114 | + if ( empty( $matches[ 0 ] ) || ! function_exists( 'wpautop' ) ) { |
|
| 115 | 115 | return $raw_value; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | private static function modifier_maxwords( $raw_value, $matches ) { |
| 137 | 137 | |
| 138 | - if( ! is_string( $raw_value ) || empty( $matches[1] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
| 138 | + if ( ! is_string( $raw_value ) || empty( $matches[ 1 ] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
| 139 | 139 | return $raw_value; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $max = intval( $matches[1] ); |
|
| 142 | + $max = intval( $matches[ 1 ] ); |
|
| 143 | 143 | |
| 144 | 144 | $more_placeholder = '[GVMORE]'; |
| 145 | 145 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param array $aux_data Additional data to be used to replace merge tags {@see https://www.gravityhelp.com/documentation/article/gform_merge_tag_data/} |
| 176 | 176 | * @return string Text with variables maybe replaced |
| 177 | 177 | */ |
| 178 | - public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true, $nl2br = true, $format = 'html', $aux_data = array() ) { |
|
| 178 | + public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true, $nl2br = true, $format = 'html', $aux_data = array() ) { |
|
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | 181 | * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | * @internal Fixed $form['title'] in Gravity Forms |
| 201 | 201 | * @see https://github.com/gravityforms/gravityforms/pull/27/files |
| 202 | 202 | */ |
| 203 | - $form['title'] = isset( $form['title'] ) ? $form['title'] : ''; |
|
| 204 | - $form['id'] = isset( $form['id'] ) ? $form['id'] : ''; |
|
| 205 | - $form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array(); |
|
| 203 | + $form[ 'title' ] = isset( $form[ 'title' ] ) ? $form[ 'title' ] : ''; |
|
| 204 | + $form[ 'id' ] = isset( $form[ 'id' ] ) ? $form[ 'id' ] : ''; |
|
| 205 | + $form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array(); |
|
| 206 | 206 | |
| 207 | 207 | return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format, $aux_data ); |
| 208 | 208 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
| 226 | 226 | |
| 227 | - if( '' === $text ) { |
|
| 227 | + if ( '' === $text ) { |
|
| 228 | 228 | return $text; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @see GFCommon::replace_variables_prepopulate() |
| 235 | 235 | * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14 |
| 236 | 236 | */ |
| 237 | - if( false === $form ) { |
|
| 237 | + if ( false === $form ) { |
|
| 238 | 238 | return $text; |
| 239 | 239 | } |
| 240 | 240 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
| 269 | 269 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
| 270 | 270 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
| 271 | - 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 271 | + 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 272 | 272 | ); |
| 273 | 273 | |
| 274 | 274 | $formatted_date = GVCommon::format_date( $date_created, $atts ); |
@@ -345,8 +345,8 @@ discard block |
||
| 345 | 345 | return $original_text; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - foreach ( (array) $matches as $match ) { |
|
| 349 | - $full_tag = $match[0]; |
|
| 348 | + foreach ( (array)$matches as $match ) { |
|
| 349 | + $full_tag = $match[ 0 ]; |
|
| 350 | 350 | $modifier = rgar( $match, 2, 'permalink' ); |
| 351 | 351 | |
| 352 | 352 | $replacement = false; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $replacement = esc_html( $replacement ); |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - if( $url_encode ) { |
|
| 367 | + if ( $url_encode ) { |
|
| 368 | 368 | $replacement = urlencode( $replacement ); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -404,14 +404,14 @@ discard block |
||
| 404 | 404 | preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER ); |
| 405 | 405 | |
| 406 | 406 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
| 407 | - if( empty( $matches ) ) { |
|
| 407 | + if ( empty( $matches ) ) { |
|
| 408 | 408 | return $text; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | foreach ( $matches as $match ) { |
| 412 | 412 | |
| 413 | - $full_tag = $match[0]; |
|
| 414 | - $property = $match[1]; |
|
| 413 | + $full_tag = $match[ 0 ]; |
|
| 414 | + $property = $match[ 1 ]; |
|
| 415 | 415 | |
| 416 | 416 | $value = stripslashes_deep( rgget( $property ) ); |
| 417 | 417 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | * @since 1.15 |
| 436 | 436 | * @param bool $esc_html Whether to esc_html() the value. Default: `true` |
| 437 | 437 | */ |
| 438 | - $esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 438 | + $esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 439 | 439 | |
| 440 | 440 | $value = $esc_html ? esc_html( $value ) : $value; |
| 441 | 441 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | * @param[in] array $form Gravity Forms form array |
| 447 | 447 | * @param[in] array $entry Entry array |
| 448 | 448 | */ |
| 449 | - $value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 449 | + $value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 450 | 450 | |
| 451 | 451 | $text = str_replace( $full_tag, $value, $text ); |
| 452 | 452 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | parent::add_hooks(); |
| 69 | 69 | |
| 70 | - if( gravityview_is_admin_page() ) { |
|
| 70 | + if ( gravityview_is_admin_page() ) { |
|
| 71 | 71 | |
| 72 | 72 | // Make Yoast metabox go down to the bottom please. |
| 73 | 73 | add_filter( 'wpseo_metabox_prio', array( $this, '__return_low' ) ); |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function disable_content_analysis( $options ) { |
| 94 | 94 | |
| 95 | - $options['keyword_analysis_active'] = false; |
|
| 96 | - $options['content_analysis_active'] = false; |
|
| 95 | + $options[ 'keyword_analysis_active' ] = false; |
|
| 96 | + $options[ 'content_analysis_active' ] = false; |
|
| 97 | 97 | |
| 98 | 98 | return $options; |
| 99 | 99 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | global $pagenow; |
| 113 | 113 | |
| 114 | 114 | // New View page |
| 115 | - if( $pagenow === 'post-new.php' ) { |
|
| 116 | - $options['hideeditbox-gravityview'] = true; |
|
| 115 | + if ( $pagenow === 'post-new.php' ) { |
|
| 116 | + $options[ 'hideeditbox-gravityview' ] = true; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $options; |