Completed
Push — master ( ff34a2...c00646 )
by Zack
46:25 queued 35:42
created
future/includes/class-gv-settings-addon.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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&amp;page=gravityview_settings' );
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
752 752
 				'label' => __( 'License Key', 'gravityview' ),
753 753
 				'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; 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&hellip;', '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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
includes/class-api.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -236,7 +236,6 @@  discard block
 block discarded – undo
236 236
 	 *
237 237
 	 * @access public
238 238
 	 * @param array $entry
239
-	 * @param array $field
240 239
 	 * @return null|string
241 240
 	 */
242 241
 	public static function field_value( $entry, $field_settings, $format = 'html' ) {
@@ -741,6 +740,9 @@  discard block
 block discarded – undo
741 740
 	return $value;
742 741
 }
743 742
 
743
+/**
744
+ * @param GV\Template_Context $context
745
+ */
744 746
 function gv_directory_link( $post = NULL, $add_pagination = true, $context = null ) {
745 747
 	return GravityView_API::directory_link( $post, $add_pagination, $context );
746 748
 }
@@ -1216,6 +1218,7 @@  discard block
 block discarded – undo
1216 1218
  * @param  array $passed_args Associative array with field data. `field` and `form` are required.
1217 1219
  * @since  2.0
1218 1220
  * @param  \GV\Template_Context The template context.
1221
+ * @param GV\Template_Context $context
1219 1222
  * @return string Field output. If empty value and hide empty is true, return empty.
1220 1223
  */
1221 1224
 function gravityview_field_output( $passed_args, $context = null ) {
Please login to merge, or discard this patch.
future/includes/class-gv-renderer-entry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 		do_action( 'gravityview_render_entry_' . $view->ID, $entry, $view, $request );
55 55
 
56 56
 		/** Entry does not belong to this view. */
57
-		if ( $view->form && $view->form->ID != $entry['form_id'] ) {
57
+		if ( $view->form && $view->form->ID != $entry[ 'form_id' ] ) {
58 58
 			gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $entry->ID, 'view_id' => $view->ID ) );
59 59
 			return null;
60 60
 		}
Please login to merge, or discard this patch.
includes/class-template.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -328,34 +328,34 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 ) ) {
Please login to merge, or discard this patch.