@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | * @param array $callback_args Arguments passed to the callback |
| 98 | 98 | * @return void |
| 99 | 99 | */ |
| 100 | - function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array() ) { |
|
| 100 | + function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array() ) { |
|
| 101 | 101 | |
| 102 | - $this->id = $this->prefix.$id; |
|
| 102 | + $this->id = $this->prefix . $id; |
|
| 103 | 103 | $this->title = $title; |
| 104 | 104 | $this->render_template_file = $file; |
| 105 | 105 | $this->callback = $callback; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | function parse_icon_class_name( $icon_class_name = '' ) { |
| 120 | 120 | |
| 121 | - if( preg_match( '/dashicon/i', $icon_class_name ) ) { |
|
| 121 | + if ( preg_match( '/dashicon/i', $icon_class_name ) ) { |
|
| 122 | 122 | $icon_class_name = 'dashicons ' . $icon_class_name; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -142,29 +142,29 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | function render( $post ) { |
| 144 | 144 | |
| 145 | - if( !empty( $this->render_template_file ) ) { |
|
| 145 | + if ( ! empty( $this->render_template_file ) ) { |
|
| 146 | 146 | |
| 147 | 147 | $file = $this->render_template_file; |
| 148 | 148 | |
| 149 | 149 | // If the full path exists, use it |
| 150 | - if( file_exists( $file ) ) { |
|
| 150 | + if ( file_exists( $file ) ) { |
|
| 151 | 151 | $path = $file; |
| 152 | 152 | } else { |
| 153 | - $path = GRAVITYVIEW_DIR .'includes/admin/metaboxes/views/'.$file; |
|
| 153 | + $path = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/views/' . $file; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if( file_exists( $path ) ) { |
|
| 156 | + if ( file_exists( $path ) ) { |
|
| 157 | 157 | include $path; |
| 158 | 158 | } else { |
| 159 | 159 | gravityview()->log->error( 'Metabox template file not found', array( 'data' => $this ) ); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - } else if( !empty( $this->callback ) ) { |
|
| 162 | + } else if ( ! empty( $this->callback ) ) { |
|
| 163 | 163 | |
| 164 | - if( is_callable( $this->callback ) ) { |
|
| 164 | + if ( is_callable( $this->callback ) ) { |
|
| 165 | 165 | |
| 166 | 166 | /** @see do_accordion_sections() */ |
| 167 | - call_user_func( $this->callback, $post, (array) $this ); |
|
| 167 | + call_user_func( $this->callback, $post, (array)$this ); |
|
| 168 | 168 | |
| 169 | 169 | } else { |
| 170 | 170 | gravityview()->log->error( 'Metabox callback was not callable', array( 'data' => $this ) ); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | static function getInstance() { |
| 43 | 43 | gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' ); |
| 44 | 44 | |
| 45 | - if( empty( self::$instance ) ) { |
|
| 45 | + if ( empty( self::$instance ) ) { |
|
| 46 | 46 | self::$instance = new self; |
| 47 | 47 | self::$instance->initialize(); |
| 48 | 48 | } |
@@ -333,8 +333,8 @@ discard block |
||
| 333 | 333 | * @param mixed $field_id Field ID or Field array |
| 334 | 334 | * @return string field type |
| 335 | 335 | */ |
| 336 | -function gravityview_get_field_type( $form = null , $field_id = '' ) { |
|
| 337 | - return GVCommon::get_field_type( $form, $field_id ); |
|
| 336 | +function gravityview_get_field_type( $form = null, $field_id = '' ) { |
|
| 337 | + return GVCommon::get_field_type( $form, $field_id ); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | * @return string HTML of the output. Empty string if $view_id is empty. |
| 348 | 348 | */ |
| 349 | 349 | function get_gravityview( $view_id = '', $atts = array() ) { |
| 350 | - if( !empty( $view_id ) ) { |
|
| 351 | - $atts['id'] = $view_id; |
|
| 350 | + if ( ! empty( $view_id ) ) { |
|
| 351 | + $atts[ 'id' ] = $view_id; |
|
| 352 | 352 | $args = wp_parse_args( $atts, \GV\View_Settings::defaults() ); |
| 353 | 353 | $GravityView_frontend = GravityView_frontend::getInstance(); |
| 354 | 354 | $GravityView_frontend->setGvOutputData( GravityView_View_Data::getInstance( $view_id ) ); |
@@ -391,19 +391,19 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | function gravityview_view_has_single_checkbox_or_radio( $form, $view_fields ) { |
| 393 | 393 | |
| 394 | - if( class_exists('GFFormsModel') && $form_fields = GFFormsModel::get_fields_by_type( $form, array( 'checkbox', 'radio' ) ) ) { |
|
| 394 | + if ( class_exists( 'GFFormsModel' ) && $form_fields = GFFormsModel::get_fields_by_type( $form, array( 'checkbox', 'radio' ) ) ) { |
|
| 395 | 395 | |
| 396 | 396 | /** @var GF_Field_Radio|GF_Field_Checkbox $form_field */ |
| 397 | - foreach( $form_fields as $form_field ) { |
|
| 397 | + foreach ( $form_fields as $form_field ) { |
|
| 398 | 398 | $field_id = $form_field->id; |
| 399 | - foreach( $view_fields as $zone ) { |
|
| 399 | + foreach ( $view_fields as $zone ) { |
|
| 400 | 400 | |
| 401 | 401 | // ACF compatibility; ACF-added fields aren't arrays |
| 402 | 402 | if ( ! is_array( $zone ) ) { continue; } |
| 403 | 403 | |
| 404 | - foreach( $zone as $field ) { |
|
| 404 | + foreach ( $zone as $field ) { |
|
| 405 | 405 | // If it's an input, not the parent and the parent ID matches a checkbox or radio |
| 406 | - if( ( strpos( $field['id'], '.' ) > 0 ) && floor( $field['id'] ) === floor( $field_id ) ) { |
|
| 406 | + if ( ( strpos( $field[ 'id' ], '.' ) > 0 ) && floor( $field[ 'id' ] ) === floor( $field_id ) ) { |
|
| 407 | 407 | return true; |
| 408 | 408 | } |
| 409 | 409 | } |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | // matching regex => the value is the method to call to replace the value. |
| 53 | 53 | $gv_modifiers = array( |
| 54 | 54 | 'maxwords:(\d+)' => 'modifier_maxwords', /** @see modifier_maxwords */ |
| 55 | - 'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */ |
|
| 55 | + 'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */ |
|
| 56 | 56 | 'explode' => 'modifier_explode', /** @see modifier_explode */ |
| 57 | 57 | |
| 58 | 58 | /** @see modifier_strings */ |
| 59 | 59 | 'urlencode' => 'modifier_strings', |
| 60 | 60 | 'wpautop' => 'modifier_strings', |
| 61 | - 'esc_html' => 'modifier_strings', |
|
| 62 | - 'sanitize_html_class' => 'modifier_strings', |
|
| 61 | + 'esc_html' => 'modifier_strings', |
|
| 62 | + 'sanitize_html_class' => 'modifier_strings', |
|
| 63 | 63 | 'sanitize_title' => 'modifier_strings', |
| 64 | 64 | 'strtolower' => 'modifier_strings', |
| 65 | 65 | 'strtoupper' => 'modifier_strings', |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | $atts = array( |
| 459 | 459 | 'format' => self::get_format_from_modifiers( $exploded, false ), |
| 460 | - 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
| 460 | + 'human' => in_array( 'human', $exploded ), // {date_created:human} |
|
| 461 | 461 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
| 462 | 462 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
| 463 | 463 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $non_gv_modifiers = array_diff( $modifiers, array_keys( $gv_modifiers ) ); |
| 80 | 80 | |
| 81 | - $return = $field->get_value_merge_tag( $value, '', array( 'currency' => '' ), array(), implode( '', $non_gv_modifiers ), $raw_value, false, false, 'text', false); |
|
| 81 | + $return = $field->get_value_merge_tag( $value, '', array( 'currency' => '' ), array(), implode( '', $non_gv_modifiers ), $raw_value, false, false, 'text', false ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | foreach ( $modifiers as $passed_modifier ) { |
| 85 | 85 | |
| 86 | - foreach( $gv_modifiers as $gv_modifier => $method ) { |
|
| 86 | + foreach ( $gv_modifiers as $gv_modifier => $method ) { |
|
| 87 | 87 | |
| 88 | 88 | // Uses ^ to only match the first modifier, to enforce same order as passed by GF |
| 89 | 89 | preg_match( '/^' . $gv_modifier . '/ism', $passed_modifier, $matches ); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | private static function modifier_timestamp( $raw_value, $matches ) { |
| 134 | 134 | |
| 135 | - if( empty( $matches[0] ) ) { |
|
| 135 | + if ( empty( $matches[ 0 ] ) ) { |
|
| 136 | 136 | return $raw_value; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private static function modifier_maxwords( $raw_value, $matches, $field = null ) { |
| 163 | 163 | |
| 164 | - if( ! is_string( $raw_value ) || empty( $matches[1] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
| 164 | + if ( ! is_string( $raw_value ) || empty( $matches[ 1 ] ) || ! function_exists( 'wp_trim_words' ) ) { |
|
| 165 | 165 | return $raw_value; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - $max = intval( $matches[1] ); |
|
| 168 | + $max = intval( $matches[ 1 ] ); |
|
| 169 | 169 | |
| 170 | 170 | $more_placeholder = '[GVMORE]'; |
| 171 | 171 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | private static function modifier_explode( $raw_value, $matches, $value, $field = null ) { |
| 235 | 235 | |
| 236 | 236 | // For JSON-encoded arrays |
| 237 | - if( $json_array = json_decode( $raw_value, true ) ) { |
|
| 237 | + if ( $json_array = json_decode( $raw_value, true ) ) { |
|
| 238 | 238 | return implode( ' ', $json_array ); |
| 239 | 239 | } |
| 240 | 240 | |
@@ -255,13 +255,13 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | private static function modifier_strings( $raw_value, $matches, $value = '', $field = null ) { |
| 257 | 257 | |
| 258 | - if( empty( $matches[0] ) ) { |
|
| 258 | + if ( empty( $matches[ 0 ] ) ) { |
|
| 259 | 259 | return $raw_value; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $return = $raw_value; |
| 263 | 263 | |
| 264 | - switch( $matches[0] ) { |
|
| 264 | + switch ( $matches[ 0 ] ) { |
|
| 265 | 265 | case 'urlencode': |
| 266 | 266 | $return = urlencode( $raw_value ); |
| 267 | 267 | break; |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | * @internal Fixed $form['title'] in Gravity Forms |
| 349 | 349 | * @see https://github.com/gravityforms/gravityforms/pull/27/files |
| 350 | 350 | */ |
| 351 | - $form['title'] = isset( $form['title'] ) ? $form['title'] : ''; |
|
| 352 | - $form['id'] = isset( $form['id'] ) ? $form['id'] : ''; |
|
| 353 | - $form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array(); |
|
| 351 | + $form[ 'title' ] = isset( $form[ 'title' ] ) ? $form[ 'title' ] : ''; |
|
| 352 | + $form[ 'id' ] = isset( $form[ 'id' ] ) ? $form[ 'id' ] : ''; |
|
| 353 | + $form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array(); |
|
| 354 | 354 | |
| 355 | 355 | return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format, $aux_data ); |
| 356 | 356 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | $site_url = get_site_url(); |
| 444 | 444 | |
| 445 | - if( $url_encode ) { |
|
| 445 | + if ( $url_encode ) { |
|
| 446 | 446 | $site_url = urlencode( $site_url ); |
| 447 | 447 | } |
| 448 | 448 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | // Is there is {gv_entry_link} or {gv_entry_link:[post id]} or {gv_entry_link:[post id]:[action]} merge tag? |
| 470 | 470 | preg_match_all( "/{gv_entry_link(?:\:(\d+)\:?(.*?))?}/ism", $original_text, $matches, PREG_SET_ORDER ); |
| 471 | 471 | |
| 472 | - if( empty( $matches ) ) { |
|
| 472 | + if ( empty( $matches ) ) { |
|
| 473 | 473 | return $original_text; |
| 474 | 474 | } |
| 475 | 475 | |
@@ -490,18 +490,18 @@ discard block |
||
| 490 | 490 | * } |
| 491 | 491 | */ |
| 492 | 492 | foreach ( $matches as $match ) { |
| 493 | - $full_tag = $match[0]; |
|
| 493 | + $full_tag = $match[ 0 ]; |
|
| 494 | 494 | |
| 495 | 495 | $link_args = array( |
| 496 | 496 | 'return' => 'url', |
| 497 | - 'entry_id' => $entry['id'], |
|
| 497 | + 'entry_id' => $entry[ 'id' ], |
|
| 498 | 498 | 'post_id' => \GV\Utils::get( $match, 1, null ), |
| 499 | 499 | 'action' => \GV\Utils::get( $match, 2, 'read' ), |
| 500 | 500 | ); |
| 501 | 501 | |
| 502 | 502 | $entry_link = $Shortcode->read_shortcode( $link_args, null, 'gv_entry_link_merge_tag' ); |
| 503 | 503 | |
| 504 | - if( $url_encode ) { |
|
| 504 | + if ( $url_encode ) { |
|
| 505 | 505 | $entry_link = urlencode( $entry_link ); |
| 506 | 506 | } |
| 507 | 507 | |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | 'diff' => in_array( 'diff', $exploded ), // {date_created:diff} |
| 540 | 540 | 'raw' => in_array( 'raw', $exploded ), // {date_created:raw} |
| 541 | 541 | 'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp} |
| 542 | - 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 542 | + 'time' => in_array( 'time', $exploded ), // {date_created:time} |
|
| 543 | 543 | ); |
| 544 | 544 | |
| 545 | 545 | $formatted_date = GVCommon::format_date( $date_created, $atts ); |
@@ -616,8 +616,8 @@ discard block |
||
| 616 | 616 | return $original_text; |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | - foreach ( (array) $matches as $match ) { |
|
| 620 | - $full_tag = $match[0]; |
|
| 619 | + foreach ( (array)$matches as $match ) { |
|
| 620 | + $full_tag = $match[ 0 ]; |
|
| 621 | 621 | $modifier = \GV\Utils::get( $match, 2, 'permalink' ); |
| 622 | 622 | |
| 623 | 623 | $replacement = false; |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | $replacement = esc_html( $replacement ); |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - if( $url_encode ) { |
|
| 638 | + if ( $url_encode ) { |
|
| 639 | 639 | $replacement = urlencode( $replacement ); |
| 640 | 640 | } |
| 641 | 641 | |
@@ -675,14 +675,14 @@ discard block |
||
| 675 | 675 | preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER ); |
| 676 | 676 | |
| 677 | 677 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
| 678 | - if( empty( $matches ) ) { |
|
| 678 | + if ( empty( $matches ) ) { |
|
| 679 | 679 | return $text; |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | foreach ( $matches as $match ) { |
| 683 | 683 | |
| 684 | - $full_tag = $match[0]; |
|
| 685 | - $property = $match[1]; |
|
| 684 | + $full_tag = $match[ 0 ]; |
|
| 685 | + $property = $match[ 1 ]; |
|
| 686 | 686 | |
| 687 | 687 | $value = stripslashes_deep( \GV\Utils::_GET( $property ) ); |
| 688 | 688 | |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | * @since 1.15 |
| 707 | 707 | * @param bool $esc_html Whether to esc_html() the value. Default: `true` |
| 708 | 708 | */ |
| 709 | - $esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 709 | + $esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true ); |
|
| 710 | 710 | |
| 711 | 711 | $value = $esc_html ? esc_html( $value ) : $value; |
| 712 | 712 | |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | * @param array $form Gravity Forms form array |
| 718 | 718 | * @param array $entry Entry array |
| 719 | 719 | */ |
| 720 | - $value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 720 | + $value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry ); |
|
| 721 | 721 | |
| 722 | 722 | $text = str_replace( $full_tag, $value, $text ); |
| 723 | 723 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | private function add_hooks() { |
| 38 | - /** @see \GV\Field::get_value_filters */ |
|
| 38 | + /** @see \GV\Field::get_value_filters */ |
|
| 39 | 39 | add_filter( "gravityview/field/{$this->name}/output", array( $this, 'get_content' ), 4, 2 ); |
| 40 | 40 | add_action( 'gravityview/template/after', array( $this, 'print_script'), 10, 1 ); |
| 41 | 41 | add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 ); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function get_content( $output, $template ) { |
| 77 | 77 | $entry = $template->entry; |
| 78 | 78 | |
| 79 | - $star_url = GFCommon::get_base_url() .'/images/star' . intval( $entry['is_starred'] ) .'.png'; |
|
| 79 | + $star_url = GFCommon::get_base_url() .'/images/star' . intval( $entry['is_starred'] ) .'.png'; |
|
| 80 | 80 | |
| 81 | 81 | $entry_id = ''; |
| 82 | 82 | |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Add JS to the bottom of the View if there is a star field and user has `gravityview_edit_entries` cap |
| 97 | - * |
|
| 97 | + * |
|
| 98 | 98 | * @param \GV\Template_Context $context The template context |
| 99 | - * @since 2.0 |
|
| 100 | - * |
|
| 101 | - * @return void |
|
| 99 | + * @since 2.0 |
|
| 100 | + * |
|
| 101 | + * @return void |
|
| 102 | 102 | */ |
| 103 | 103 | public function print_script( $context ) { |
| 104 | 104 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if ( ! GravityView_Roles_Capabilities::has_cap( 'gravityview_edit_entries' ) ) { |
| 110 | - return; |
|
| 110 | + return; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | private function add_hooks() { |
| 38 | 38 | /** @see \GV\Field::get_value_filters */ |
| 39 | 39 | add_filter( "gravityview/field/{$this->name}/output", array( $this, 'get_content' ), 4, 2 ); |
| 40 | - add_action( 'gravityview/template/after', array( $this, 'print_script'), 10, 1 ); |
|
| 40 | + add_action( 'gravityview/template/after', array( $this, 'print_script' ), 10, 1 ); |
|
| 41 | 41 | add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 ); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | function add_default_field( $entry_default_fields = array(), $form = array(), $zone = '' ) { |
| 54 | 54 | |
| 55 | - if( 'edit' !== $zone ) { |
|
| 55 | + if ( 'edit' !== $zone ) { |
|
| 56 | 56 | $entry_default_fields[ $this->name ] = array( |
| 57 | 57 | 'label' => $this->label, |
| 58 | 58 | 'desc' => $this->description, |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function get_content( $output, $template ) { |
| 77 | 77 | $entry = $template->entry; |
| 78 | 78 | |
| 79 | - $star_url = GFCommon::get_base_url() .'/images/star' . intval( $entry['is_starred'] ) .'.png'; |
|
| 79 | + $star_url = GFCommon::get_base_url() . '/images/star' . intval( $entry[ 'is_starred' ] ) . '.png'; |
|
| 80 | 80 | |
| 81 | 81 | $entry_id = ''; |
| 82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // if( $show_as_star ) |
| 88 | - $output = '<img class="gv-star-image" '.$entry_id.' data-is_starred="'. intval( $entry['is_starred'] ) .'" src="'. esc_attr( $star_url ) .'" />'; |
|
| 88 | + $output = '<img class="gv-star-image" ' . $entry_id . ' data-is_starred="' . intval( $entry[ 'is_starred' ] ) . '" src="' . esc_attr( $star_url ) . '" />'; |
|
| 89 | 89 | |
| 90 | 90 | self::$has_star_field = true; |
| 91 | 91 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function print_script( $context ) { |
| 104 | 104 | |
| 105 | - if( ! self::$has_star_field ) { |
|
| 105 | + if ( ! self::$has_star_field ) { |
|
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) { |
| 50 | 50 | |
| 51 | 51 | /** Overridden by a template. */ |
| 52 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
| 52 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
| 53 | 53 | |
| 54 | 54 | $amount = \GV\Utils::get( $entry, 'payment_amount' ); |
| 55 | 55 | $return = GFCommon::to_money( $amount, \GV\Utils::get( $entry, 'currency' ) ); |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return string Original text if {date_created} isn't found. Otherwise, replaced text. |
| 90 | 90 | */ |
| 91 | - public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 91 | + public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 92 | 92 | |
| 93 | 93 | $return = $text; |
| 94 | 94 | |
| 95 | 95 | foreach ( $matches as $match ) { |
| 96 | 96 | |
| 97 | - $full_tag = $match[0]; |
|
| 98 | - $modifier = isset( $match[1] ) ? $match[1] : false; |
|
| 97 | + $full_tag = $match[ 0 ]; |
|
| 98 | + $modifier = isset( $match[ 1 ] ) ? $match[ 1 ] : false; |
|
| 99 | 99 | |
| 100 | 100 | $amount = \GV\Utils::get( $entry, 'payment_amount' ); |
| 101 | 101 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | global $post; |
| 35 | 35 | |
| 36 | 36 | if ( $post ) { |
| 37 | - $context['post'] = $post; |
|
| 37 | + $context[ 'post' ] = $post; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | \GV\Mocks\Legacy_Context::push( $context ); |
@@ -328,34 +328,34 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /** |
| 331 | - * Get the fields for a specific context |
|
| 332 | - * |
|
| 333 | - * @since 1.19.2 |
|
| 334 | - * |
|
| 331 | + * Get the fields for a specific context |
|
| 332 | + * |
|
| 333 | + * @since 1.19.2 |
|
| 334 | + * |
|
| 335 | 335 | * @param string $context [Optional] "directory", "single", or "edit" |
| 336 | 336 | * |
| 337 | 337 | * @return array Array of GravityView field layout configurations |
| 338 | 338 | */ |
| 339 | 339 | public function getContextFields( $context = '' ) { |
| 340 | 340 | |
| 341 | - if( '' === $context ) { |
|
| 342 | - $context = $this->getContext(); |
|
| 343 | - } |
|
| 341 | + if( '' === $context ) { |
|
| 342 | + $context = $this->getContext(); |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | 345 | $fields = $this->getFields(); |
| 346 | 346 | |
| 347 | - foreach ( (array) $fields as $key => $context_fields ) { |
|
| 347 | + foreach ( (array) $fields as $key => $context_fields ) { |
|
| 348 | 348 | |
| 349 | - // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | - $matches = explode( '_', $key ); |
|
| 349 | + // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | + $matches = explode( '_', $key ); |
|
| 351 | 351 | |
| 352 | - if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | - return $context_fields; |
|
| 354 | - } |
|
| 355 | - } |
|
| 352 | + if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | + return $context_fields; |
|
| 354 | + } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | return array(); |
| 358 | - } |
|
| 358 | + } |
|
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | 361 | * @param array $fields |
@@ -448,10 +448,10 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function getPaging() { |
| 450 | 450 | |
| 451 | - $default_params = array( |
|
| 452 | - 'offset' => 0, |
|
| 453 | - 'page_size' => 20, |
|
| 454 | - ); |
|
| 451 | + $default_params = array( |
|
| 452 | + 'offset' => 0, |
|
| 453 | + 'page_size' => 20, |
|
| 454 | + ); |
|
| 455 | 455 | |
| 456 | 456 | return wp_parse_args( $this->paging, $default_params ); |
| 457 | 457 | } |
@@ -508,10 +508,10 @@ discard block |
||
| 508 | 508 | public function getSorting() { |
| 509 | 509 | |
| 510 | 510 | $defaults_params = array( |
| 511 | - 'sort_field' => 'date_created', |
|
| 512 | - 'sort_direction' => 'ASC', |
|
| 513 | - 'is_numeric' => false, |
|
| 514 | - ); |
|
| 511 | + 'sort_field' => 'date_created', |
|
| 512 | + 'sort_direction' => 'ASC', |
|
| 513 | + 'is_numeric' => false, |
|
| 514 | + ); |
|
| 515 | 515 | |
| 516 | 516 | return wp_parse_args( $this->sorting, $defaults_params ); |
| 517 | 517 | } |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | */ |
| 838 | 838 | public function render_widget_hooks( $view_id_or_context ) { |
| 839 | 839 | |
| 840 | - /** |
|
| 840 | + /** |
|
| 841 | 841 | * @deprecated Numeric argument is deprecated. Pass a \GV\Template_Context instead. |
| 842 | 842 | */ |
| 843 | 843 | if ( is_numeric( $view_id_or_context ) ) { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | die; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if( ! class_exists( '\GV\Gamajo_Template_Loader' ) ) { |
|
| 19 | +if ( ! class_exists( '\GV\Gamajo_Template_Loader' ) ) { |
|
| 20 | 20 | require( GRAVITYVIEW_DIR . 'future/lib/class-gamajo-template-loader.php' ); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | 'atts' => NULL, |
| 165 | 165 | ) ); |
| 166 | 166 | |
| 167 | - foreach ($atts as $key => $value) { |
|
| 168 | - if( is_null( $value ) ) { |
|
| 167 | + foreach ( $atts as $key => $value ) { |
|
| 168 | + if ( is_null( $value ) ) { |
|
| 169 | 169 | continue; |
| 170 | 170 | } |
| 171 | 171 | $this->{$key} = $value; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | static function getInstance( $passed_post = NULL ) { |
| 197 | 197 | |
| 198 | - if( empty( self::$instance ) ) { |
|
| 198 | + if ( empty( self::$instance ) ) { |
|
| 199 | 199 | self::$instance = new self( $passed_post ); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function getCurrentField( $key = NULL ) { |
| 210 | 210 | |
| 211 | - if( !empty( $key ) ) { |
|
| 212 | - if( isset( $this->_current_field[ $key ] ) ) { |
|
| 211 | + if ( ! empty( $key ) ) { |
|
| 212 | + if ( isset( $this->_current_field[ $key ] ) ) { |
|
| 213 | 213 | return $this->_current_field[ $key ]; |
| 214 | 214 | } |
| 215 | 215 | return NULL; |
@@ -220,16 +220,16 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | public function setCurrentFieldSetting( $key, $value ) { |
| 222 | 222 | |
| 223 | - if( !empty( $this->_current_field ) ) { |
|
| 224 | - $this->_current_field['field_settings'][ $key ] = $value; |
|
| 223 | + if ( ! empty( $this->_current_field ) ) { |
|
| 224 | + $this->_current_field[ 'field_settings' ][ $key ] = $value; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | public function getCurrentFieldSetting( $key ) { |
| 230 | - $settings = $this->getCurrentField('field_settings'); |
|
| 230 | + $settings = $this->getCurrentField( 'field_settings' ); |
|
| 231 | 231 | |
| 232 | - if( $settings && !empty( $settings[ $key ] ) ) { |
|
| 232 | + if ( $settings && ! empty( $settings[ $key ] ) ) { |
|
| 233 | 233 | return $settings[ $key ]; |
| 234 | 234 | } |
| 235 | 235 | |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function getAtts( $key = NULL ) { |
| 262 | 262 | |
| 263 | - if( !empty( $key ) ) { |
|
| 264 | - if( isset( $this->atts[ $key ] ) ) { |
|
| 263 | + if ( ! empty( $key ) ) { |
|
| 264 | + if ( isset( $this->atts[ $key ] ) ) { |
|
| 265 | 265 | return $this->atts[ $key ]; |
| 266 | 266 | } |
| 267 | 267 | return NULL; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | $fields = empty( $this->fields ) ? NULL : $this->fields; |
| 329 | 329 | |
| 330 | - if( $fields && !empty( $key ) ) { |
|
| 330 | + if ( $fields && ! empty( $key ) ) { |
|
| 331 | 331 | $fields = isset( $fields[ $key ] ) ? $fields[ $key ] : NULL; |
| 332 | 332 | } |
| 333 | 333 | |
@@ -345,18 +345,18 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function getContextFields( $context = '' ) { |
| 347 | 347 | |
| 348 | - if( '' === $context ) { |
|
| 348 | + if ( '' === $context ) { |
|
| 349 | 349 | $context = $this->getContext(); |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | $fields = $this->getFields(); |
| 353 | 353 | |
| 354 | - foreach ( (array) $fields as $key => $context_fields ) { |
|
| 354 | + foreach ( (array)$fields as $key => $context_fields ) { |
|
| 355 | 355 | |
| 356 | 356 | // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
| 357 | 357 | $matches = explode( '_', $key ); |
| 358 | 358 | |
| 359 | - if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 359 | + if ( isset( $matches[ 0 ] ) && $matches[ 0 ] === $context ) { |
|
| 360 | 360 | return $context_fields; |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -377,8 +377,8 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | public function getField( $key ) { |
| 379 | 379 | |
| 380 | - if( !empty( $key ) ) { |
|
| 381 | - if( isset( $this->fields[ $key ] ) ) { |
|
| 380 | + if ( ! empty( $key ) ) { |
|
| 381 | + if ( isset( $this->fields[ $key ] ) ) { |
|
| 382 | 382 | return $this->fields[ $key ]; |
| 383 | 383 | } |
| 384 | 384 | } |
@@ -484,8 +484,8 @@ discard block |
||
| 484 | 484 | public function getPaginationCounts() { |
| 485 | 485 | |
| 486 | 486 | $paging = $this->getPaging(); |
| 487 | - $offset = $paging['offset']; |
|
| 488 | - $page_size = $paging['page_size']; |
|
| 487 | + $offset = $paging[ 'offset' ]; |
|
| 488 | + $page_size = $paging[ 'page_size' ]; |
|
| 489 | 489 | $total = $this->getTotalEntries(); |
| 490 | 490 | |
| 491 | 491 | if ( empty( $total ) ) { |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | */ |
| 507 | 507 | list( $first, $last, $total ) = apply_filters( 'gravityview_pagination_counts', array( $first, $last, $total ) ); |
| 508 | 508 | |
| 509 | - return array( 'first' => (int) $first, 'last' => (int) $last, 'total' => (int) $total ); |
|
| 509 | + return array( 'first' => (int)$first, 'last' => (int)$last, 'total' => (int)$total ); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | /** |
@@ -602,16 +602,16 @@ discard block |
||
| 602 | 602 | */ |
| 603 | 603 | public function getCurrentEntry() { |
| 604 | 604 | |
| 605 | - if( in_array( $this->getContext(), array( 'edit', 'single') ) ) { |
|
| 605 | + if ( in_array( $this->getContext(), array( 'edit', 'single' ) ) ) { |
|
| 606 | 606 | $entries = $this->getEntries(); |
| 607 | - $entry = $entries[0]; |
|
| 607 | + $entry = $entries[ 0 ]; |
|
| 608 | 608 | } else { |
| 609 | 609 | $entry = $this->_current_entry; |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | /** @since 1.16 Fixes DataTables empty entry issue */ |
| 613 | - if ( empty( $entry ) && ! empty( $this->_current_field['entry'] ) ) { |
|
| 614 | - $entry = $this->_current_field['entry']; |
|
| 613 | + if ( empty( $entry ) && ! empty( $this->_current_field[ 'entry' ] ) ) { |
|
| 614 | + $entry = $this->_current_field[ 'entry' ]; |
|
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | return $entry; |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | public function renderZone( $zone = '', $atts = array(), $echo = true ) { |
| 652 | 652 | |
| 653 | 653 | if ( empty( $zone ) ) { |
| 654 | - gravityview()->log->error( 'No zone defined.'); |
|
| 654 | + gravityview()->log->error( 'No zone defined.' ); |
|
| 655 | 655 | return NULL; |
| 656 | 656 | } |
| 657 | 657 | |
@@ -660,16 +660,16 @@ discard block |
||
| 660 | 660 | 'context' => $this->getContext(), |
| 661 | 661 | 'entry' => $this->getCurrentEntry(), |
| 662 | 662 | 'form' => $this->getForm(), |
| 663 | - 'hide_empty' => $this->getAtts('hide_empty'), |
|
| 663 | + 'hide_empty' => $this->getAtts( 'hide_empty' ), |
|
| 664 | 664 | ); |
| 665 | 665 | |
| 666 | 666 | $final_atts = wp_parse_args( $atts, $defaults ); |
| 667 | 667 | |
| 668 | 668 | $output = ''; |
| 669 | 669 | |
| 670 | - $final_atts['zone_id'] = "{$final_atts['context']}_{$final_atts['slug']}-{$zone}"; |
|
| 670 | + $final_atts[ 'zone_id' ] = "{$final_atts[ 'context' ]}_{$final_atts[ 'slug' ]}-{$zone}"; |
|
| 671 | 671 | |
| 672 | - $fields = $this->getField( $final_atts['zone_id'] ); |
|
| 672 | + $fields = $this->getField( $final_atts[ 'zone_id' ] ); |
|
| 673 | 673 | |
| 674 | 674 | // Backward compatibility |
| 675 | 675 | if ( 'table' === $this->getTemplatePartSlug() ) { |
@@ -679,19 +679,19 @@ discard block |
||
| 679 | 679 | * @param \GravityView_View $this |
| 680 | 680 | * @deprecated Use `gravityview/template/table/fields` |
| 681 | 681 | */ |
| 682 | - $fields = apply_filters("gravityview_table_cells", $fields, $this ); |
|
| 682 | + $fields = apply_filters( "gravityview_table_cells", $fields, $this ); |
|
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | if ( empty( $fields ) ) { |
| 686 | 686 | |
| 687 | - gravityview()->log->warning( 'Empty zone configuration for {zone_id}.', array( 'zone_id' => $final_atts['zone_id'] ) ); |
|
| 687 | + gravityview()->log->warning( 'Empty zone configuration for {zone_id}.', array( 'zone_id' => $final_atts[ 'zone_id' ] ) ); |
|
| 688 | 688 | |
| 689 | 689 | return NULL; |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | $field_output = ''; |
| 693 | 693 | foreach ( $fields as $field ) { |
| 694 | - $final_atts['field'] = $field; |
|
| 694 | + $final_atts[ 'field' ] = $field; |
|
| 695 | 695 | |
| 696 | 696 | $field_output .= gravityview_field_output( $final_atts ); |
| 697 | 697 | } |
@@ -708,17 +708,17 @@ discard block |
||
| 708 | 708 | return NULL; |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | - if( !empty( $final_atts['wrapper_class'] ) ) { |
|
| 712 | - $output .= '<div class="'.gravityview_sanitize_html_class( $final_atts['wrapper_class'] ).'">'; |
|
| 711 | + if ( ! empty( $final_atts[ 'wrapper_class' ] ) ) { |
|
| 712 | + $output .= '<div class="' . gravityview_sanitize_html_class( $final_atts[ 'wrapper_class' ] ) . '">'; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | $output .= $field_output; |
| 716 | 716 | |
| 717 | - if( !empty( $final_atts['wrapper_class'] ) ) { |
|
| 717 | + if ( ! empty( $final_atts[ 'wrapper_class' ] ) ) { |
|
| 718 | 718 | $output .= '</div>'; |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | - if( $echo ) { |
|
| 721 | + if ( $echo ) { |
|
| 722 | 722 | echo $output; |
| 723 | 723 | } |
| 724 | 724 | |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | */ |
| 737 | 737 | function locate_template( $template_names, $load = false, $require_once = true ) { |
| 738 | 738 | |
| 739 | - if( is_string( $template_names ) && isset( $this->located_templates[ $template_names ] ) ) { |
|
| 739 | + if ( is_string( $template_names ) && isset( $this->located_templates[ $template_names ] ) ) { |
|
| 740 | 740 | |
| 741 | 741 | $located = $this->located_templates[ $template_names ]; |
| 742 | 742 | |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | // Set $load to always false so we handle it here. |
| 746 | 746 | $located = parent::locate_template( $template_names, false, $require_once ); |
| 747 | 747 | |
| 748 | - if( is_string( $template_names ) ) { |
|
| 748 | + if ( is_string( $template_names ) ) { |
|
| 749 | 749 | $this->located_templates[ $template_names ] = $located; |
| 750 | 750 | } |
| 751 | 751 | } |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | * @return mixed|null The stored data. |
| 764 | 764 | */ |
| 765 | 765 | public function __get( $name ) { |
| 766 | - if( isset( $this->{$name} ) ) { |
|
| 766 | + if ( isset( $this->{$name} ) ) { |
|
| 767 | 767 | return $this->{$name}; |
| 768 | 768 | } else { |
| 769 | 769 | return NULL; |
@@ -792,17 +792,17 @@ discard block |
||
| 792 | 792 | $additional = array(); |
| 793 | 793 | |
| 794 | 794 | // form-19-table-body.php |
| 795 | - $additional[] = sprintf( 'form-%d-%s-%s.php', $this->getFormId(), $slug, $name ); |
|
| 795 | + $additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->getFormId(), $slug, $name ); |
|
| 796 | 796 | |
| 797 | - if( $view_id = $this->getViewId() ) { |
|
| 797 | + if ( $view_id = $this->getViewId() ) { |
|
| 798 | 798 | // view-3-table-body.php |
| 799 | - $additional[] = sprintf( 'view-%d-%s-%s.php', $view_id, $slug, $name ); |
|
| 799 | + $additional[ ] = sprintf( 'view-%d-%s-%s.php', $view_id, $slug, $name ); |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | - if( $this->getPostId() ) { |
|
| 802 | + if ( $this->getPostId() ) { |
|
| 803 | 803 | |
| 804 | 804 | // page-19-table-body.php |
| 805 | - $additional[] = sprintf( 'page-%d-%s-%s.php', $this->getPostId(), $slug, $name ); |
|
| 805 | + $additional[ ] = sprintf( 'page-%d-%s-%s.php', $this->getPostId(), $slug, $name ); |
|
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // Combine with existing table-body.php and table.php |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | gravityview()->log->debug( 'Rendering Template File: {path}', array( 'path' => $template_file ) ); |
| 826 | 826 | |
| 827 | - if( !empty( $template_file) ) { |
|
| 827 | + if ( ! empty( $template_file ) ) { |
|
| 828 | 828 | |
| 829 | 829 | if ( $require_once ) { |
| 830 | 830 | require_once( $template_file ); |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | |
| 900 | 900 | // Prevent being called twice |
| 901 | 901 | if ( did_action( "gravityview/widgets/$zone/{$view->ID}/rendered" ) ) { |
| 902 | - gravityview()->log->debug( 'Not rendering {zone}; already rendered', array( 'zone' => $zone.'_'.$view->ID.'_widgets' ) ); |
|
| 902 | + gravityview()->log->debug( 'Not rendering {zone}; already rendered', array( 'zone' => $zone . '_' . $view->ID . '_widgets' ) ); |
|
| 903 | 903 | return; |
| 904 | 904 | } |
| 905 | 905 | |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | * @param string $zone Current widget zone, either `header` or `footer` |
| 922 | 922 | * @param array $widgets Array of widget configurations for the current zone, as set by `gravityview_get_current_view_data()['widgets']` |
| 923 | 923 | */ |
| 924 | - $css_class = apply_filters('gravityview/widgets/wrapper_css_class', $default_css_class, $zone, $widgets->as_configuration() ); |
|
| 924 | + $css_class = apply_filters( 'gravityview/widgets/wrapper_css_class', $default_css_class, $zone, $widgets->as_configuration() ); |
|
| 925 | 925 | |
| 926 | 926 | $css_class = gravityview_sanitize_html_class( $css_class ); |
| 927 | 927 | |
@@ -929,15 +929,15 @@ discard block |
||
| 929 | 929 | ?> |
| 930 | 930 | <div class="<?php echo $css_class; ?>"> |
| 931 | 931 | <?php |
| 932 | - foreach( $rows as $row ) { |
|
| 933 | - foreach( $row as $col => $areas ) { |
|
| 932 | + foreach ( $rows as $row ) { |
|
| 933 | + foreach ( $row as $col => $areas ) { |
|
| 934 | 934 | $column = ( $col == '2-2' ) ? '1-2 gv-right' : "$col gv-left"; |
| 935 | 935 | ?> |
| 936 | 936 | <div class="gv-grid-col-<?php echo esc_attr( $column ); ?>"> |
| 937 | 937 | <?php |
| 938 | 938 | if ( ! empty( $areas ) ) { |
| 939 | 939 | foreach ( $areas as $area ) { |
| 940 | - foreach ( $widgets->by_position( $zone . '_' . $area['areaid'] )->all() as $widget ) { |
|
| 940 | + foreach ( $widgets->by_position( $zone . '_' . $area[ 'areaid' ] )->all() as $widget ) { |
|
| 941 | 941 | do_action( sprintf( 'gravityview/widgets/%s/render', $widget->get_widget_id() ), $widget->configuration->all(), null, $view_id_or_context ); |
| 942 | 942 | } |
| 943 | 943 | } |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | do_action( 'gravityview/template/list/body/before', $context ); |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | - * @action `gravityview_list_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 155 | - * @deprecated Use `gravityview/template/list/body/before` |
|
| 156 | - * @since 1.0.7 |
|
| 157 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 158 | - */ |
|
| 154 | + * @action `gravityview_list_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 155 | + * @deprecated Use `gravityview/template/list/body/before` |
|
| 156 | + * @since 1.0.7 |
|
| 157 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 158 | + */ |
|
| 159 | 159 | do_action( 'gravityview_list_body_before', \GravityView_View::getInstance() /** ugh! */ ); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | do_action( 'gravityview/template/list/body/after', $context ); |
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | - * @action `gravityview_list_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 181 | - * @deprecated Use `gravityview/template/list/body/after` |
|
| 182 | - * @since 1.0.7 |
|
| 183 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 184 | - */ |
|
| 180 | + * @action `gravityview_list_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 181 | + * @deprecated Use `gravityview/template/list/body/after` |
|
| 182 | + * @since 1.0.7 |
|
| 183 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 184 | + */ |
|
| 185 | 185 | do_action( 'gravityview_list_body_after', \GravityView_View::getInstance() /** ugh! */ ); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -212,11 +212,11 @@ discard block |
||
| 212 | 212 | $zone = str_replace( '/', '_', $zone ); |
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | - * @action `gravityview_list_entry_$zone_before` Inside the `entry`, before any rows are rendered. Can be used to insert additional rows. |
|
| 216 | - * @deprecated Use `gravityview/template/list/entry/$zone/before` |
|
| 217 | - * @since 1.0.7 |
|
| 218 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 219 | - */ |
|
| 215 | + * @action `gravityview_list_entry_$zone_before` Inside the `entry`, before any rows are rendered. Can be used to insert additional rows. |
|
| 216 | + * @deprecated Use `gravityview/template/list/entry/$zone/before` |
|
| 217 | + * @since 1.0.7 |
|
| 218 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 219 | + */ |
|
| 220 | 220 | do_action( sprintf( 'gravityview_list_entry%sbefore', $zone ), $entry->as_entry(), \GravityView_View::getInstance() /** ugh! */ ); |
| 221 | 221 | } |
| 222 | 222 | |
@@ -247,11 +247,11 @@ discard block |
||
| 247 | 247 | $zone = str_replace( '/', '_', $zone ); |
| 248 | 248 | |
| 249 | 249 | /** |
| 250 | - * @action `gravityview_list_entry_$zone_after` Inside the `entry`, after any rows are rendered. Can be used to insert additional rows. |
|
| 251 | - * @deprecated Use `gravityview/template/list/entry/after` |
|
| 252 | - * @since 1.0.7 |
|
| 253 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 254 | - */ |
|
| 250 | + * @action `gravityview_list_entry_$zone_after` Inside the `entry`, after any rows are rendered. Can be used to insert additional rows. |
|
| 251 | + * @deprecated Use `gravityview/template/list/entry/after` |
|
| 252 | + * @since 1.0.7 |
|
| 253 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 254 | + */ |
|
| 255 | 255 | do_action( sprintf( 'gravityview_list_entry%safter', $zone ), $entry->as_entry(), \GravityView_View::getInstance() /** ugh! */ ); |
| 256 | 256 | } |
| 257 | 257 | } |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | public function the_field( \GV\Field $field, \GV\Entry $entry, $extras = null ) { |
| 30 | 30 | $form = $this->view->form; |
| 31 | 31 | |
| 32 | - if ( isset( $this->view->unions[ $entry['form_id'] ] ) ) { |
|
| 33 | - if ( isset( $this->view->unions[ $entry['form_id'] ][ $field->ID ] ) ) { |
|
| 34 | - $field = $this->view->unions[ $entry['form_id'] ][ $field->ID ]; |
|
| 32 | + if ( isset( $this->view->unions[ $entry[ 'form_id' ] ] ) ) { |
|
| 33 | + if ( isset( $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ] ) ) { |
|
| 34 | + $field = $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ]; |
|
| 35 | 35 | } elseif ( ! $field instanceof Internal_Field ) { |
| 36 | 36 | $field = Internal_Field::from_configuration( array( 'id' => 'custom' ) ); |
| 37 | 37 | } |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | $hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context ); |
| 82 | 82 | |
| 83 | 83 | if ( is_numeric( $field->ID ) ) { |
| 84 | - $extras['field'] = $field->as_configuration(); |
|
| 84 | + $extras[ 'field' ] = $field->as_configuration(); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $extras['entry'] = $entry->as_entry(); |
|
| 88 | - $extras['hide_empty'] = $hide_empty; |
|
| 89 | - $extras['label'] = $label; |
|
| 90 | - $extras['value'] = $value; |
|
| 87 | + $extras[ 'entry' ] = $entry->as_entry(); |
|
| 88 | + $extras[ 'hide_empty' ] = $hide_empty; |
|
| 89 | + $extras[ 'label' ] = $label; |
|
| 90 | + $extras[ 'value' ] = $value; |
|
| 91 | 91 | |
| 92 | 92 | return \gravityview_field_output( $extras, $context ); |
| 93 | 93 | } |