@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $enable_custom_class = apply_filters( 'gravityview/widget/enable_custom_class', false, $this ); |
| 152 | 152 | |
| 153 | 153 | if ( $enable_custom_class ) { |
| 154 | - $settings['custom_class'] = array( |
|
| 154 | + $settings[ 'custom_class' ] = array( |
|
| 155 | 155 | 'type' => 'text', |
| 156 | 156 | 'label' => __( 'Custom CSS Class:', 'gravityview' ), |
| 157 | 157 | 'desc' => __( 'This class will be added to the widget container', 'gravityview' ), |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public static function get_default_widget_areas() { |
| 205 | 205 | $default_areas = array( |
| 206 | - array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ) , 'subtitle' => '' ) ) ), |
|
| 207 | - array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ) , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ) , 'subtitle' => '' ) ) ), |
|
| 206 | + array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
| 207 | + array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ), |
|
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | $widgets[ $this->get_widget_id() ] = array( |
| 237 | - 'label' => $this->widget_label , |
|
| 237 | + 'label' => $this->widget_label, |
|
| 238 | 238 | 'description' => $this->widget_description, |
| 239 | 239 | 'subtitle' => $this->widget_subtitle, |
| 240 | 240 | 'class' => get_called_class(), |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public function assign_widget_options( $options = array(), $template = '', $widget = '' ) { |
| 257 | 257 | if ( $this->get_widget_id() === $widget ) { |
| 258 | - if( $settings = $this->get_settings() ) { |
|
| 258 | + if ( $settings = $this->get_settings() ) { |
|
| 259 | 259 | $options = array_merge( $options, $settings ); |
| 260 | 260 | } |
| 261 | 261 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | return; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') ); |
|
| 309 | + add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) ); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return array |
| 102 | 102 | */ |
| 103 | 103 | public function modify_app_settings_menu_title( $setting_tabs ) { |
| 104 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
| 104 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
| 105 | 105 | return $setting_tabs; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -304,15 +304,15 @@ discard block |
||
| 304 | 304 | </ul> |
| 305 | 305 | <div class="gv-followup widefat"> |
| 306 | 306 | <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
| 307 | - <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea> |
|
| 307 | + <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea> |
|
| 308 | 308 | </div> |
| 309 | 309 | <div class="scale-description"> |
| 310 | 310 | <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
| 311 | 311 | <ul class="inline"> |
| 312 | 312 | <?php |
| 313 | 313 | $i = 0; |
| 314 | - while( $i < 11 ) { |
|
| 315 | - echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
| 314 | + while ( $i < 11 ) { |
|
| 315 | + echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
| 316 | 316 | $i++; |
| 317 | 317 | } |
| 318 | 318 | ?> |
@@ -529,15 +529,15 @@ discard block |
||
| 529 | 529 | * @return string The HTML |
| 530 | 530 | */ |
| 531 | 531 | public function as_html( $field, $echo = true ) { |
| 532 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
| 532 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 533 | 533 | |
| 534 | 534 | $attributes = $this->get_field_attributes( $field ); |
| 535 | 535 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 536 | - $value = $this->get( $field['name'], $default_value ); |
|
| 536 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 537 | 537 | |
| 538 | 538 | |
| 539 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
| 540 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 539 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
| 540 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 541 | 541 | |
| 542 | 542 | if ( empty( $value ) ) { |
| 543 | 543 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $attributes = $this->get_field_attributes( $field ); |
| 547 | 547 | |
| 548 | 548 | $html = '<input |
| 549 | - type="' . $field['type'] . '" |
|
| 549 | + type="' . $field[ 'type' ] . '" |
|
| 550 | 550 | name="' . esc_attr( $name ) . '" |
| 551 | 551 | value="' . $value . '" ' . |
| 552 | 552 | implode( ' ', $attributes ) . |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | public function license_key_notice() { |
| 576 | 576 | $license_status = $this->get( 'license_key_status' ); |
| 577 | 577 | $license_key = $this->get( 'license_key' ); |
| 578 | - if( '' === $license_key ) { |
|
| 578 | + if ( '' === $license_key ) { |
|
| 579 | 579 | $license_status = 'inactive'; |
| 580 | 580 | } |
| 581 | 581 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | * but didn't want to mess up the translation strings for the translators. |
| 588 | 588 | */ |
| 589 | 589 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
| 590 | - $title = __ ( 'Inactive License', 'gravityview'); |
|
| 590 | + $title = __( 'Inactive License', 'gravityview' ); |
|
| 591 | 591 | $status = ''; |
| 592 | 592 | $update_below = false; |
| 593 | 593 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $update_below = __( 'Activate your license key below.', 'gravityview' ); |
| 618 | 618 | break; |
| 619 | 619 | } |
| 620 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
| 620 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
| 621 | 621 | |
| 622 | 622 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
| 623 | 623 | if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | public function scripts() { |
| 660 | 660 | $scripts = parent::scripts(); |
| 661 | 661 | |
| 662 | - $scripts[] = array( |
|
| 662 | + $scripts[ ] = array( |
|
| 663 | 663 | 'handle' => 'gform_tooltip_init', |
| 664 | 664 | 'enqueue' => array( |
| 665 | 665 | array( |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | public function styles() { |
| 679 | 679 | $styles = parent::styles(); |
| 680 | 680 | |
| 681 | - $styles[] = array( |
|
| 681 | + $styles[ ] = array( |
|
| 682 | 682 | 'handle' => 'gravityview_settings', |
| 683 | 683 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 684 | 684 | 'version' => Plugin::$version, |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | * If multisite and not network admin, we don't want the settings to show. |
| 710 | 710 | * @since 1.7.6 |
| 711 | 711 | */ |
| 712 | - $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 712 | + $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 713 | 713 | |
| 714 | 714 | /** |
| 715 | 715 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -752,26 +752,26 @@ discard block |
||
| 752 | 752 | 'label' => __( 'License Key', 'gravityview' ), |
| 753 | 753 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ), |
| 754 | 754 | 'type' => 'edd_license', |
| 755 | - 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 755 | + 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 756 | 756 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 757 | - 'default_value' => $default_settings['license_key'], |
|
| 757 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 758 | 758 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 759 | 759 | ), |
| 760 | 760 | array( |
| 761 | 761 | 'name' => 'license_key_response', |
| 762 | - 'default_value' => $default_settings['license_key_response'], |
|
| 762 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 763 | 763 | 'type' => 'hidden', |
| 764 | 764 | ), |
| 765 | 765 | array( |
| 766 | 766 | 'name' => 'license_key_status', |
| 767 | - 'default_value' => $default_settings['license_key_status'], |
|
| 767 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 768 | 768 | 'type' => 'hidden', |
| 769 | 769 | ), |
| 770 | 770 | array( |
| 771 | 771 | 'name' => 'support-email', |
| 772 | 772 | 'type' => 'text', |
| 773 | 773 | 'validate' => 'email', |
| 774 | - 'default_value' => $default_settings['support-email'], |
|
| 774 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 775 | 775 | 'label' => __( 'Support Email', 'gravityview' ), |
| 776 | 776 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 777 | 777 | 'class' => 'code regular-text', |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | 'name' => 'support_port', |
| 784 | 784 | 'type' => 'radio', |
| 785 | 785 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 786 | - 'default_value' => $default_settings['support_port'], |
|
| 786 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 787 | 787 | 'horizontal' => 1, |
| 788 | 788 | 'choices' => array( |
| 789 | 789 | array( |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | 'name' => 'no-conflict-mode', |
| 803 | 803 | 'type' => 'radio', |
| 804 | 804 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 805 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 805 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 806 | 806 | 'horizontal' => 1, |
| 807 | 807 | 'choices' => array( |
| 808 | 808 | array( |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | 'name' => 'rest_api', |
| 825 | 825 | 'type' => 'radio', |
| 826 | 826 | 'label' => __( 'REST API', 'gravityview' ), |
| 827 | - 'default_value' => $default_settings['rest_api'], |
|
| 827 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 828 | 828 | 'horizontal' => 1, |
| 829 | 829 | 'choices' => array( |
| 830 | 830 | array( |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | 'name' => 'beta', |
| 844 | 844 | 'type' => 'checkbox', |
| 845 | 845 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 846 | - 'default_value' => $default_settings['beta'], |
|
| 846 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 847 | 847 | 'horizontal' => 1, |
| 848 | 848 | 'choices' => array( |
| 849 | 849 | array( |
@@ -876,17 +876,17 @@ discard block |
||
| 876 | 876 | * @since 1.7.4 |
| 877 | 877 | */ |
| 878 | 878 | foreach ( $fields as &$field ) { |
| 879 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 880 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 881 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 882 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 879 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 880 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 881 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 882 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 883 | 883 | |
| 884 | 884 | if ( $disabled_attribute ) { |
| 885 | - $field['disabled'] = $disabled_attribute; |
|
| 885 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 886 | 886 | } |
| 887 | 887 | |
| 888 | - if ( empty( $field['disabled'] ) ) { |
|
| 889 | - unset( $field['disabled'] ); |
|
| 888 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 889 | + unset( $field[ 'disabled' ] ); |
|
| 890 | 890 | } |
| 891 | 891 | } |
| 892 | 892 | |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | ); |
| 905 | 905 | |
| 906 | 906 | if ( $disabled_attribute ) { |
| 907 | - $button['disabled'] = $disabled_attribute; |
|
| 907 | + $button[ 'disabled' ] = $disabled_attribute; |
|
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | /** |
@@ -923,20 +923,20 @@ discard block |
||
| 923 | 923 | // If there are extensions, add a section for them |
| 924 | 924 | if ( ! empty( $extension_sections ) ) { |
| 925 | 925 | |
| 926 | - if( $disabled_attribute ) { |
|
| 926 | + if ( $disabled_attribute ) { |
|
| 927 | 927 | foreach ( $extension_sections as &$section ) { |
| 928 | - foreach ( $section['fields'] as &$field ) { |
|
| 929 | - $field['disabled'] = $disabled_attribute; |
|
| 928 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 929 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 930 | 930 | } |
| 931 | 931 | } |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | - $k = count( $extension_sections ) - 1 ; |
|
| 935 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 934 | + $k = count( $extension_sections ) - 1; |
|
| 935 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
| 936 | 936 | $sections = array_merge( $sections, $extension_sections ); |
| 937 | 937 | } else { |
| 938 | 938 | // add the 'update settings' button to the general section |
| 939 | - $sections[0]['fields'][] = $button; |
|
| 939 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | return $sections; |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | protected function settings_edd_license( $field, $echo = true ) { |
| 993 | 993 | |
| 994 | 994 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 995 | - $field['input_type'] = 'password'; |
|
| 995 | + $field[ 'input_type' ] = 'password'; |
|
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | $text = $this->settings_text( $field, false ); |
@@ -1017,10 +1017,10 @@ discard block |
||
| 1017 | 1017 | * @return string |
| 1018 | 1018 | */ |
| 1019 | 1019 | public function settings_save( $field, $echo = true ) { |
| 1020 | - $field['type'] = 'submit'; |
|
| 1021 | - $field['name'] = 'gform-settings-save'; |
|
| 1022 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
| 1023 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1020 | + $field[ 'type' ] = 'submit'; |
|
| 1021 | + $field[ 'name' ] = 'gform-settings-save'; |
|
| 1022 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
| 1023 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1024 | 1024 | |
| 1025 | 1025 | $output = $this->settings_submit( $field, false ); |
| 1026 | 1026 | |
@@ -1051,8 +1051,8 @@ discard block |
||
| 1051 | 1051 | * @return void |
| 1052 | 1052 | */ |
| 1053 | 1053 | public function single_setting_row( $field ) { |
| 1054 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1055 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1054 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1055 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1056 | 1056 | parent::single_setting_row( $field ); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | public function single_setting_label( $field ) { |
| 1065 | 1065 | parent::single_setting_label( $field ); |
| 1066 | 1066 | if ( $description = Utils::get( $field, 'gv_description' ) ) { |
| 1067 | - echo '<span class="description">'. $description .'</span>'; |
|
| 1067 | + echo '<span class="description">' . $description . '</span>'; |
|
| 1068 | 1068 | } |
| 1069 | 1069 | } |
| 1070 | 1070 | |
@@ -1101,9 +1101,9 @@ discard block |
||
| 1101 | 1101 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
| 1102 | 1102 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1103 | 1103 | if ( $local_key !== $response_key ) { |
| 1104 | - unset( $posted_settings['license_key_response'] ); |
|
| 1105 | - unset( $posted_settings['license_key_status'] ); |
|
| 1106 | - GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1104 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1105 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1106 | + GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1107 | 1107 | } |
| 1108 | 1108 | return $posted_settings; |
| 1109 | 1109 | } |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | $tab = wp_parse_args( $tab_settings, $tab_defaults ); |
| 181 | 181 | |
| 182 | 182 | // Force the screen to be GravityView |
| 183 | - $tab['screen'] = 'gravityview'; |
|
| 183 | + $tab[ 'screen' ] = 'gravityview'; |
|
| 184 | 184 | |
| 185 | 185 | if ( class_exists( 'GravityView_Metabox_Tab' ) ) { |
| 186 | - $metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] ); |
|
| 186 | + $metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] ); |
|
| 187 | 187 | \GravityView_Metabox_Tabs::add( $metabox ); |
| 188 | 188 | } else { |
| 189 | - add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] ); |
|
| 189 | + add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] ); |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function is_extension_supported() { |
| 213 | 213 | |
| 214 | - self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible ); |
|
| 214 | + self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible ); |
|
| 215 | 215 | |
| 216 | 216 | if ( ! function_exists( 'gravityview' ) ) { |
| 217 | 217 | $message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) ); |
| 218 | - } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) { |
|
| 219 | - $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' ); |
|
| 220 | - } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) { |
|
| 221 | - $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' ); |
|
| 218 | + } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) { |
|
| 219 | + $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' ); |
|
| 220 | + } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) { |
|
| 221 | + $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' ); |
|
| 222 | 222 | } else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) { |
| 223 | 223 | $message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) ); |
| 224 | 224 | } else { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $lang_dir = dirname( plugin_basename( $path ) ) . '/languages/'; |
| 258 | 258 | |
| 259 | 259 | // Traditional WordPress plugin locale filter |
| 260 | - $locale = apply_filters( 'plugin_locale', get_locale(), $this->_text_domain ); |
|
| 260 | + $locale = apply_filters( 'plugin_locale', get_locale(), $this->_text_domain ); |
|
| 261 | 261 | |
| 262 | 262 | $mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale ); |
| 263 | 263 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | public function settings() { |
| 286 | 286 | // If doing ajax, get outta here |
| 287 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
|
| 287 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
|
| 288 | 288 | return; |
| 289 | 289 | } |
| 290 | 290 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | // Don't update if invalid license. |
| 298 | - if ( false === $license || empty( $license['status'] ) || strtolower( $license['status'] ) !== 'valid' ) { |
|
| 298 | + if ( false === $license || empty( $license[ 'status' ] ) || strtolower( $license[ 'status' ] ) !== 'valid' ) { |
|
| 299 | 299 | return; |
| 300 | 300 | } |
| 301 | 301 | |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | $this->_path, |
| 305 | 305 | array( |
| 306 | 306 | 'version' => $this->_version, // current version number |
| 307 | - 'license' => $license['license'], |
|
| 307 | + 'license' => $license[ 'license' ], |
|
| 308 | 308 | 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
| 309 | - 'item_name' => $this->_title, // name of this plugin |
|
| 309 | + 'item_name' => $this->_title, // name of this plugin |
|
| 310 | 310 | 'author' => strip_tags( $this->_author ) // author of this plugin |
| 311 | 311 | ) |
| 312 | 312 | ); |
@@ -335,16 +335,16 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | public static function add_notice( $notice = array() ) { |
| 337 | 337 | |
| 338 | - if ( is_array( $notice ) && empty( $notice['message'] ) ) { |
|
| 338 | + if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) { |
|
| 339 | 339 | gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) ); |
| 340 | 340 | return; |
| 341 | 341 | } else if ( is_string( $notice ) ) { |
| 342 | 342 | $notice = array( 'message' => $notice ); |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - $notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class']; |
|
| 345 | + $notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ]; |
|
| 346 | 346 | |
| 347 | - self::$admin_notices []= $notice; |
|
| 347 | + self::$admin_notices [ ] = $notice; |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
@@ -358,8 +358,8 @@ discard block |
||
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | foreach ( self::$admin_notices as $key => $notice ) { |
| 361 | - echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">'; |
|
| 362 | - echo wpautop( $notice['message'] ); |
|
| 361 | + echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">'; |
|
| 362 | + echo wpautop( $notice[ 'message' ] ); |
|
| 363 | 363 | echo '<div class="clear"></div>'; |
| 364 | 364 | echo '</div>'; |
| 365 | 365 | } |
@@ -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 ); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | wp_embed_register_handler( 'gravityview_entry', self::get_entry_regex(), array( __CLASS__, 'render' ), 20000 ); |
| 27 | 27 | wp_oembed_add_provider( self::get_entry_regex(), self::$provider_url, true ); |
| 28 | 28 | |
| 29 | - if ( ! empty( $_GET['gv_oembed_provider'] ) && ! empty( $_GET['url'] ) ) { |
|
| 29 | + if ( ! empty( $_GET[ 'gv_oembed_provider' ] ) && ! empty( $_GET[ 'url' ] ) ) { |
|
| 30 | 30 | add_action( 'template_redirect', array( __CLASS__, 'render_provider_request' ) ); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | public static function render_provider_request() { |
| 46 | - if ( ! empty( $_GET['url'] ) ) { |
|
| 47 | - $url = $_GET['url']; |
|
| 46 | + if ( ! empty( $_GET[ 'url' ] ) ) { |
|
| 47 | + $url = $_GET[ 'url' ]; |
|
| 48 | 48 | } else { |
| 49 | 49 | header( 'HTTP/1.0 404 Not Found' ); |
| 50 | 50 | exit; |
@@ -111,18 +111,18 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | private static function parse_matches( $matches, $url ) { |
| 113 | 113 | // If not using permalinks, re-assign values for matching groups |
| 114 | - if ( ! empty( $matches['entry_slug2'] ) ) { |
|
| 115 | - $matches['is_cpt'] = $matches['is_cpt2']; |
|
| 116 | - $matches['slug'] = $matches['slug2']; |
|
| 117 | - $matches['entry_slug'] = $matches['entry_slug2']; |
|
| 118 | - unset( $matches['is_cpt2'], $matches['slug2'], $matches['entry_slug2'] ); |
|
| 114 | + if ( ! empty( $matches[ 'entry_slug2' ] ) ) { |
|
| 115 | + $matches[ 'is_cpt' ] = $matches[ 'is_cpt2' ]; |
|
| 116 | + $matches[ 'slug' ] = $matches[ 'slug2' ]; |
|
| 117 | + $matches[ 'entry_slug' ] = $matches[ 'entry_slug2' ]; |
|
| 118 | + unset( $matches[ 'is_cpt2' ], $matches[ 'slug2' ], $matches[ 'entry_slug2' ] ); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - if ( empty( $matches['entry_slug'] ) ) { |
|
| 121 | + if ( empty( $matches[ 'entry_slug' ] ) ) { |
|
| 122 | 122 | gravityview()->log->error( 'Entry slug not parsed by regex.', array( 'data' => $matches ) ); |
| 123 | 123 | return null; |
| 124 | 124 | } else { |
| 125 | - $entry_id = $matches['entry_slug']; |
|
| 125 | + $entry_id = $matches[ 'entry_slug' ]; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if ( ! $entry = \GV\GF_Entry::by_id( $entry_id ) ) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if ( ! $view_id = url_to_postid( $url ) ) { |
| 134 | - $view = \GV\View::from_post( get_page_by_path( $matches['slug'], OBJECT, 'gravityview' ) ); |
|
| 134 | + $view = \GV\View::from_post( get_page_by_path( $matches[ 'slug' ], OBJECT, 'gravityview' ) ); |
|
| 135 | 135 | } else { |
| 136 | 136 | $view = \GV\View::by_id( $view_id ); |
| 137 | 137 | } |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | return ' |
| 165 | 165 | <div class="loading-placeholder" style="background-color:#e6f0f5;"> |
| 166 | - <h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image.$embed_heading.'</h3> |
|
| 166 | + <h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image . $embed_heading . '</h3> |
|
| 167 | 167 | <p style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;"> |
| 168 | - '.$embed_text.' |
|
| 168 | + '.$embed_text . ' |
|
| 169 | 169 | </p> |
| 170 | 170 | <br style="clear: both;"> |
| 171 | 171 | </div>'; |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | private static function render_preview_notice() { |
| 180 | 180 | $floaty = \GravityView_Admin::get_floaty(); |
| 181 | 181 | $title = esc_html__( 'This will look better when it is embedded.', 'gravityview' ); |
| 182 | - $message = esc_html__( 'Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview'); |
|
| 183 | - return '<div class="updated notice">'.$floaty.'<h3>'.$title.'</h3><p>'.$message.'</p><br style="clear:both;" /></div>'; |
|
| 182 | + $message = esc_html__( 'Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview' ); |
|
| 183 | + return '<div class="updated notice">' . $floaty . '<h3>' . $title . '</h3><p>' . $message . '</p><br style="clear:both;" /></div>'; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if ( $entry['status'] != 'active' ) { |
|
| 202 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 203 | 203 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 204 | 204 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if ( $view->settings->get( 'show_only_approved' ) ) { |
| 208 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 208 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 209 | 209 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 210 | 210 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 211 | 211 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | // Catch either |
| 270 | 270 | $match_regex = "(?:{$using_permalinks}|{$not_using_permalinks})"; |
| 271 | 271 | |
| 272 | - return '#'.$match_regex.'#i'; |
|
| 272 | + return '#' . $match_regex . '#i'; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -64,9 +64,9 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | $hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context ); |
| 66 | 66 | |
| 67 | - $extras['hide_empty'] = $hide_empty; |
|
| 68 | - $extras['label'] = $label; |
|
| 69 | - $extras['value'] = $value; |
|
| 67 | + $extras[ 'hide_empty' ] = $hide_empty; |
|
| 68 | + $extras[ 'label' ] = $label; |
|
| 69 | + $extras[ 'value' ] = $value; |
|
| 70 | 70 | |
| 71 | 71 | return \gravityview_field_output( $extras, $context ); |
| 72 | 72 | } |
@@ -146,59 +146,59 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if ( $this->request && $this->request->is_view() && $post ) { |
| 148 | 148 | if ( $this->field && $this->field->type ) { |
| 149 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->type, $slug_name ); |
|
| 150 | - $this->field->inputType && $specifics []= sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->inputType, $slug_name ); |
|
| 151 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->type ); |
|
| 152 | - $this->field->inputType && $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->inputType ); |
|
| 153 | - $specifics []= sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->field->type, $slug_name ); |
|
| 154 | - $this->field->inputType && $specifics []= sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->field->inputType, $slug_name ); |
|
| 155 | - $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $this->field->type ); |
|
| 156 | - $this->field->inputType && $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $this->field->inputType ); |
|
| 149 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->type, $slug_name ); |
|
| 150 | + $this->field->inputType && $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->inputType, $slug_name ); |
|
| 151 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->type ); |
|
| 152 | + $this->field->inputType && $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->field->inputType ); |
|
| 153 | + $specifics [ ] = sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->field->type, $slug_name ); |
|
| 154 | + $this->field->inputType && $specifics [ ] = sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $this->field->inputType, $slug_name ); |
|
| 155 | + $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $this->field->type ); |
|
| 156 | + $this->field->inputType && $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $this->field->inputType ); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name ); |
|
| 160 | - $specifics []= sprintf( '%spost-%d-view-%d-field.php', $slug_dir, $post->ID, $this->view->ID ); |
|
| 161 | - $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
| 162 | - $specifics []= sprintf( '%spost-%d-field.php', $slug_dir, $post->ID ); |
|
| 159 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name ); |
|
| 160 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field.php', $slug_dir, $post->ID, $this->view->ID ); |
|
| 161 | + $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
| 162 | + $specifics [ ] = sprintf( '%spost-%d-field.php', $slug_dir, $post->ID ); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** Field-specific */ |
| 166 | 166 | if ( $this->field && $this->view ) { |
| 167 | 167 | |
| 168 | 168 | if ( $this->field->ID ) { |
| 169 | - $specifics []= sprintf( '%sform-%d-field-%d-%s.php', $slug_dir, $this->view->form->ID, $this->field->ID, $slug_name ); |
|
| 170 | - $specifics []= sprintf( '%sform-%d-field-%d.php', $slug_dir, $this->view->form->ID, $this->field->ID ); |
|
| 169 | + $specifics [ ] = sprintf( '%sform-%d-field-%d-%s.php', $slug_dir, $this->view->form->ID, $this->field->ID, $slug_name ); |
|
| 170 | + $specifics [ ] = sprintf( '%sform-%d-field-%d.php', $slug_dir, $this->view->form->ID, $this->field->ID ); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if ( $this->field->type ) { |
| 174 | - $specifics []= sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $this->view->form->ID, $this->field->type, $slug_name ); |
|
| 175 | - $this->field->inputType && $specifics []= sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $this->view->form->ID, $this->field->inputType, $slug_name ); |
|
| 176 | - $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $this->field->type ); |
|
| 177 | - $this->field->inputType && $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $this->field->inputType ); |
|
| 178 | - |
|
| 179 | - $specifics []= sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $this->view->ID, $this->field->type, $slug_name ); |
|
| 180 | - $this->field->inputType && $specifics []= sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $this->view->ID, $this->field->inputType, $slug_name ); |
|
| 181 | - $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $this->field->type ); |
|
| 182 | - $this->field->inputType && $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $this->field->inputType ); |
|
| 183 | - |
|
| 184 | - $specifics []= sprintf( '%sfield-%s-%s.php', $slug_dir, $this->field->type, $slug_name ); |
|
| 185 | - $this->field->inputType && $specifics []= sprintf( '%sfield-%s-%s.php', $slug_dir, $this->field->inputType, $slug_name ); |
|
| 186 | - $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $this->field->type ); |
|
| 187 | - $this->field->inputType && $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $this->field->inputType ); |
|
| 174 | + $specifics [ ] = sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $this->view->form->ID, $this->field->type, $slug_name ); |
|
| 175 | + $this->field->inputType && $specifics [ ] = sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $this->view->form->ID, $this->field->inputType, $slug_name ); |
|
| 176 | + $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $this->field->type ); |
|
| 177 | + $this->field->inputType && $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $this->field->inputType ); |
|
| 178 | + |
|
| 179 | + $specifics [ ] = sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $this->view->ID, $this->field->type, $slug_name ); |
|
| 180 | + $this->field->inputType && $specifics [ ] = sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $this->view->ID, $this->field->inputType, $slug_name ); |
|
| 181 | + $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $this->field->type ); |
|
| 182 | + $this->field->inputType && $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $this->field->inputType ); |
|
| 183 | + |
|
| 184 | + $specifics [ ] = sprintf( '%sfield-%s-%s.php', $slug_dir, $this->field->type, $slug_name ); |
|
| 185 | + $this->field->inputType && $specifics [ ] = sprintf( '%sfield-%s-%s.php', $slug_dir, $this->field->inputType, $slug_name ); |
|
| 186 | + $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $this->field->type ); |
|
| 187 | + $this->field->inputType && $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $this->field->inputType ); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if ( $this->view ) { |
| 192 | 192 | /** Generic field templates */ |
| 193 | - $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $slug_name ); |
|
| 194 | - $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $slug_name ); |
|
| 193 | + $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $this->view->ID, $slug_name ); |
|
| 194 | + $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $this->view->form->ID, $slug_name ); |
|
| 195 | 195 | |
| 196 | - $specifics []= sprintf( '%sview-%d-field.php', $slug_dir, $this->view->ID ); |
|
| 197 | - $specifics []= sprintf( '%sform-%d-field.php', $slug_dir, $this->view->form->ID ); |
|
| 196 | + $specifics [ ] = sprintf( '%sview-%d-field.php', $slug_dir, $this->view->ID ); |
|
| 197 | + $specifics [ ] = sprintf( '%sform-%d-field.php', $slug_dir, $this->view->form->ID ); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $slug_name ); |
|
| 201 | - $specifics []= sprintf( '%sfield.php', $slug_dir ); |
|
| 200 | + $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $slug_name ); |
|
| 201 | + $specifics [ ] = sprintf( '%sfield.php', $slug_dir ); |
|
| 202 | 202 | |
| 203 | 203 | |
| 204 | 204 | return array_merge( $specifics, $templates ); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | /** Prevent any PHP warnings that may be generated. */ |
| 225 | 225 | ob_start(); |
| 226 | 226 | |
| 227 | - $display_value = \GFCommon::get_lead_field_display( $this->field->field, $value, $this->entry['currency'], false, 'html' ); |
|
| 227 | + $display_value = \GFCommon::get_lead_field_display( $this->field->field, $value, $this->entry[ 'currency' ], false, 'html' ); |
|
| 228 | 228 | |
| 229 | 229 | if ( $errors = ob_get_clean() ) { |
| 230 | 230 | gravityview()->log->error( 'Errors when calling GFCommon::get_lead_field_display()', array( 'data' => $errors ) ); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $self = new self(); |
| 56 | 56 | $self->form = $form; |
| 57 | 57 | |
| 58 | - $self->ID = $self->form['id']; |
|
| 58 | + $self->ID = $self->form[ 'id' ]; |
|
| 59 | 59 | |
| 60 | 60 | return $self; |
| 61 | 61 | } |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | /** The offset and limit */ |
| 100 | 100 | if ( ! empty( $offset->limit ) ) { |
| 101 | - $paging['page_size'] = $offset->limit; |
|
| 101 | + $paging[ 'page_size' ] = $offset->limit; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ( ! empty( $offset->offset ) ) { |
| 105 | - $paging['offset'] = $offset->offset; |
|
| 105 | + $paging[ 'offset' ] = $offset->offset; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function get_fields() { |
| 161 | 161 | $fields = array(); |
| 162 | - foreach ( $this['fields'] as $field ) { |
|
| 163 | - foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) { |
|
| 162 | + foreach ( $this[ 'fields' ] as $field ) { |
|
| 163 | + foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) { |
|
| 164 | 164 | if ( is_numeric( $id ) ) { |
| 165 | 165 | $fields[ $id ] = self::get_field( $this, $id ); |
| 166 | 166 | } else { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * @return bool Whether the offset exists or not. |
| 198 | 198 | */ |
| 199 | 199 | public function offsetExists( $offset ) { |
| 200 | - return isset( $this->form[$offset] ); |
|
| 200 | + return isset( $this->form[ $offset ] ); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @return mixed The value of the requested form data. |
| 213 | 213 | */ |
| 214 | 214 | public function offsetGet( $offset ) { |
| 215 | - return $this->form[$offset]; |
|
| 215 | + return $this->form[ $offset ]; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -113,14 +113,14 @@ |
||
| 113 | 113 | |
| 114 | 114 | /** Require critical legacy core files. @todo Deprecate */ |
| 115 | 115 | require_once $this->plugin->dir( 'includes/helper-functions.php' ); |
| 116 | - require_once $this->plugin->dir( 'includes/class-common.php'); |
|
| 117 | - require_once $this->plugin->dir( 'includes/connector-functions.php'); |
|
| 116 | + require_once $this->plugin->dir( 'includes/class-common.php' ); |
|
| 117 | + require_once $this->plugin->dir( 'includes/connector-functions.php' ); |
|
| 118 | 118 | require_once $this->plugin->dir( 'includes/class-gravityview-compatibility.php' ); |
| 119 | 119 | require_once $this->plugin->dir( 'includes/class-gravityview-roles-capabilities.php' ); |
| 120 | 120 | require_once $this->plugin->dir( 'includes/class-gravityview-admin-notices.php' ); |
| 121 | 121 | require_once $this->plugin->dir( 'includes/class-admin.php' ); |
| 122 | - require_once $this->plugin->dir( 'includes/class-post-types.php'); |
|
| 123 | - require_once $this->plugin->dir( 'includes/class-cache.php'); |
|
| 122 | + require_once $this->plugin->dir( 'includes/class-post-types.php' ); |
|
| 123 | + require_once $this->plugin->dir( 'includes/class-cache.php' ); |
|
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * GravityView extensions and widgets. |