Completed
Push — staging ( 561133...b01df1 )
by Evan
17:00
created
admin/partials/dashboard-widgets/templates/account-activity-template.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@
 block discarded – undo
8 8
 	</tr>
9 9
 	<?php 
10 10
 	$i = 1;
11
-	foreach( $account_activity as $activity ) {
12
-		if( $i <= 8 ) {
13
-		$message = $activity['message'];
14
-		$split_message = explode( ' - ' , $activity['message'] );
15
-		$split_list = explode( '"' , $split_message[0] );
16
-		if( isset( $split_list[1] ) ) {
17
-			if( isset( $activity['list_id'] ) ) {
18
-				$message = $split_list[0] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity['list_id'] ) ) . '"><strong>' . $split_list[1] . '</strong></a>'; 
11
+	foreach ( $account_activity as $activity ) {
12
+		if ( $i <= 8 ) {
13
+		$message = $activity[ 'message' ];
14
+		$split_message = explode( ' - ', $activity[ 'message' ] );
15
+		$split_list = explode( '"', $split_message[ 0 ] );
16
+		if ( isset( $split_list[ 1 ] ) ) {
17
+			if ( isset( $activity[ 'list_id' ] ) ) {
18
+				$message = $split_list[ 0 ] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity[ 'list_id' ] ) ) . '"><strong>' . $split_list[ 1 ] . '</strong></a>'; 
19 19
 			} else {
20
-				$message = $split_list[0] . ' <strong>' . $split_list[1] . '</strong>'; 
20
+				$message = $split_list[ 0 ] . ' <strong>' . $split_list[ 1 ] . '</strong>'; 
21 21
 			}
22 22
 		} else {
23
-			$message = $split_list[0];
23
+			$message = $split_list[ 0 ];
24 24
 		}
25 25
 		?>
26 26
 			<tr valign="top">
27
-				<td><label for="tablecell"><?php echo ucwords( str_replace( '-' , ' ' , str_replace( 'lists:' , '' , $activity['type'] ) ) ); ?></label></td>
27
+				<td><label for="tablecell"><?php echo ucwords( str_replace( '-', ' ', str_replace( 'lists:', '', $activity[ 'type' ] ) ) ); ?></label></td>
28 28
 				<td><?php echo $message; ?></td>
29 29
 			</tr>
30 30
 		<?php 
Please login to merge, or discard this patch.
admin/partials/welcome-page/welcome-sections/whats-new-section.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 	
3 3
 	<div class="feature-section">
4 4
 		
5
-		<h2><?php _e( 'All New Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
5
+		<h2><?php _e( 'All New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
6 6
 		
7 7
 		<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/form-layout-option.jpg'; ?>" alt="<?php _e( 'New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
8 8
 		
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 	
27 27
 	<div class="feature-section">
28 28
 		
29
-		<h2><?php _e( 'Translated & Localized' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
29
+		<h2><?php _e( 'Translated & Localized', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
30 30
 		
31
-		<p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
31
+		<p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
32 32
 		
33 33
 		<img style="width:40%;max-width:400px;display:block;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/arabic-calendar.png'; ?>" alt="<?php _e( 'Localized Arabic Calendar', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
34 34
 
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 	
39 39
 	<div class="feature-section">
40 40
 		
41
-		<h2><?php _e( 'Knowledge Base & GlotPress Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
41
+		<h2><?php _e( 'Knowledge Base & GlotPress Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
42 42
 				
43 43
 		<img style="float:left;max-width:300px;margin-right:20px;margin-left:0 !important;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/glotpress-translation-percentage.png'; ?>" alt="<?php _e( 'GlotPress Localized Precentage', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
44 44
 
45
-		<p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
45
+		<p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
46 46
 				
47
-		<p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
47
+		<p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
48 48
 		
49 49
 		<p>&nbsp;</p>
50 50
 		
51 51
 		<p><?php _e( "With a ton of help from the WordPress community, we've been able to support 7 international languages. We're always looking for additional translators, so if you are multi-lingual and can help translate things - hop into glotpress and help contribute to future development of this plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
52 52
 		
53
-		<p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
53
+		<p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
54 54
 
55 55
 		
56 56
 	</div>
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 	
60 60
 	<div class="feature-section">
61 61
 		
62
-		<h2><?php _e( 'Intuitive Settings Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
62
+		<h2><?php _e( 'Intuitive Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
63 63
 		
64 64
 		<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/settings-page.png'; ?>" alt="<?php _e( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
65 65
 
66
-		<p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
66
+		<p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
67 67
 		
68 68
 	</div>
69 69
 	
Please login to merge, or discard this patch.
admin/partials/welcome-page/welcome-sections/credits-section.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 	if ( false === ( $contributors = get_transient( 'yikes-mailchimp-contributor-transient' ) ) ) {
4 4
 		// It wasn't there, so regenerate the data and save the transient
5 5
 		$contributors = wp_remote_get( 'https://api.github.com/repos/yikesinc/yikes-inc-easy-mailchimp-extender/contributors?per_page=100', array( 'timeout' => 120 ) );
6
-		$contributors = json_decode( $contributors['body'] , true );
7
-		set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60*60*12 );
6
+		$contributors = json_decode( $contributors[ 'body' ], true );
7
+		set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60 * 60 * 12 );
8 8
 	}
9 9
 	// get the YIKES Inc. MailChimp translators via the Github API
10 10
 	if ( false === ( $translators = get_transient( 'yikes-mailchimp-translators-transient' ) ) ) {
@@ -19,20 +19,20 @@  discard block
 block discarded – undo
19 19
 		);	
20 20
 		// create an empty array to store with translator data to loop over
21 21
 		$translators = array();
22
-		foreach( $translator_usernames as $username => $language ) {
22
+		foreach ( $translator_usernames as $username => $language ) {
23 23
 			$translator_data = wp_remote_get( 'https://api.github.com/users/' . $username, array( 'timeout' => 120 ) );
24 24
 			// if( $translator_data['status'] == 200 ) {
25
-				$translators_data_decoded = json_decode( $translator_data['body'] , true );
26
-				$translators[] = array(
27
-					'login' => $translators_data_decoded['login'],
28
-					'avatar_url' => $translators_data_decoded['avatar_url'],
29
-					'html_url' => $translators_data_decoded['html_url'],
30
-					'name' => $translators_data_decoded['name'],
25
+				$translators_data_decoded = json_decode( $translator_data[ 'body' ], true );
26
+				$translators[ ] = array(
27
+					'login' => $translators_data_decoded[ 'login' ],
28
+					'avatar_url' => $translators_data_decoded[ 'avatar_url' ],
29
+					'html_url' => $translators_data_decoded[ 'html_url' ],
30
+					'name' => $translators_data_decoded[ 'name' ],
31 31
 					'translation_language' => $language,
32 32
 				);
33 33
 			// }
34 34
 		}		
35
-		set_transient( 'yikes-mailchimp-translators-transient', $translators, 60*60*12 );
35
+		set_transient( 'yikes-mailchimp-translators-transient', $translators, 60 * 60 * 12 );
36 36
 	}
37 37
 ?>
38 38
 <div class="wrap about-wrap">
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
 		<div id="credit-container">
47 47
 			<h2><?php _e( 'Developers', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
48 48
 			<?php
49
-				if( ! empty( $contributors ) ) {
50
-					$old_contributors = array( 'seriouslysean' , 'Apfelbiss', 'hiwhatsup', 'mialevesque' );
51
-						foreach( $contributors as $contributor ) {
49
+				if ( ! empty( $contributors ) ) {
50
+					$old_contributors = array( 'seriouslysean', 'Apfelbiss', 'hiwhatsup', 'mialevesque' );
51
+						foreach ( $contributors as $contributor ) {
52 52
 							// skip contributors from our old plugin (this is a new re-write)
53
-							if( ! in_array( $contributor['login'] , $old_contributors ) ) {
53
+							if ( ! in_array( $contributor[ 'login' ], $old_contributors ) ) {
54 54
 								?>
55
-								<a href="<?php echo esc_url_raw( $contributor['html_url'] ); ?>" title="<?php echo $contributor['login']; ?>" target="_blank" class="github-avatar-url">
55
+								<a href="<?php echo esc_url_raw( $contributor[ 'html_url' ] ); ?>" title="<?php echo $contributor[ 'login' ]; ?>" target="_blank" class="github-avatar-url">
56 56
 									<div class="team-member">
57
-										<img src="<?php echo esc_url_raw( $contributor['avatar_url'] ); ?>" class="github-avatar-image">
57
+										<img src="<?php echo esc_url_raw( $contributor[ 'avatar_url' ] ); ?>" class="github-avatar-image">
58 58
 										<p class="member-blurb">
59
-											<p><strong><?php echo $contributor['login']; ?></strong></p>
59
+											<p><strong><?php echo $contributor[ 'login' ]; ?></strong></p>
60 60
 										</p>
61 61
 									</div>
62 62
 								</a>
@@ -65,24 +65,24 @@  discard block
 block discarded – undo
65 65
 						}
66 66
 				} else {
67 67
 					?>
68
-						<h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
68
+						<h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
69 69
 					<?php
70 70
 				}
71 71
 			?>
72 72
 		</div>
73 73
 		
74
-		<?php if( ! empty( $translators ) ) { ?>
74
+		<?php if ( ! empty( $translators ) ) { ?>
75 75
 			<div id="translators-container">
76 76
 				<h2><?php _e( 'Translators', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
77 77
 				<?php
78
-					foreach( $translators as $translator ) {
78
+					foreach ( $translators as $translator ) {
79 79
 						?>
80
-							<a href="<?php echo esc_url_raw( $translator['html_url'] ); ?>" title="<?php echo $translator['name']; ?>" target="_blank" class="github-avatar-url">
80
+							<a href="<?php echo esc_url_raw( $translator[ 'html_url' ] ); ?>" title="<?php echo $translator[ 'name' ]; ?>" target="_blank" class="github-avatar-url">
81 81
 								<div class="translator">
82
-									<img src="<?php echo esc_url_raw( $translator['avatar_url'] ); ?>" class="github-avatar-image">
82
+									<img src="<?php echo esc_url_raw( $translator[ 'avatar_url' ] ); ?>" class="github-avatar-image">
83 83
 									<p class="member-blurb">
84
-										<p><strong><?php echo $translator['login']; ?></strong></p>
85
-										<em class="translation-language"><?php echo $translator['translation_language']; ?></em>
84
+										<p><strong><?php echo $translator[ 'login' ]; ?></strong></p>
85
+										<em class="translation-language"><?php echo $translator[ 'translation_language' ]; ?></em>
86 86
 									</p>
87 87
 								</div>
88 88
 							</a>
Please login to merge, or discard this patch.
admin/partials/welcome-page/welcome-sections/getting-started-section.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@  discard block
 block discarded – undo
1
-<?php if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { ?>
1
+<?php if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { ?>
2 2
 	<div class="about-description">
3
-		<?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>" , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>
3
+		<?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>
4 4
 	</div>
5 5
 <?php } ?>
6 6
 
7 7
 <div class="changelog">
8 8
 		
9
-	<h3><?php _e( 'Creating Your First Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
9
+	<h3><?php _e( 'Creating Your First Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
10 10
 	
11 11
 	<div class="feature-section">
12 12
 		
13 13
 		<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/create-first-optin-form.jpg'; ?>" alt="<?php _e( 'Create first optin form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image">
14 14
 					
15
-		<h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4>
16
-		<p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
15
+		<h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4>
16
+		<p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17 17
 	
18 18
 		<p>&nbsp;</p>
19 19
 		
20
-		<h4><?php _e( 'Additional Options' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
21
-		<p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
20
+		<h4><?php _e( 'Additional Options', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
21
+		<p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
22 22
 		
23 23
 	</div>
24 24
 	
@@ -26,41 +26,41 @@  discard block
 block discarded – undo
26 26
 		
27 27
 		<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/optin-settings.png'; ?>" alt="<?php _e( 'Optin settings screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-feature-image-left">
28 28
 					
29
-		<h4><?php _e( 'Customize the Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
30
-		<p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
29
+		<h4><?php _e( 'Customize the Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
30
+		<p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
31 31
 		
32 32
 		<p>&nbsp;</p>
33 33
 		
34
-		<p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
34
+		<p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
35 35
 	</div>
36 36
 	<div class="feature-section">
37 37
 		
38 38
 		<img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/add-field-to-page.png'; ?>" alt="<?php _e( 'Add field to form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image">
39 39
 					
40
-		<h4><?php _e( 'Add Form to Page/Post' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
41
-		<p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
40
+		<h4><?php _e( 'Add Form to Page/Post', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
41
+		<p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
42 42
 		
43 43
 		<p>&nbsp;</p>
44 44
 		
45
-		<h4><?php _e( 'Add Form to Widget' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
46
-		<p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
45
+		<h4><?php _e( 'Add Form to Widget', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
46
+		<p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
47 47
 	</div>
48 48
 	
49 49
 	<div class="feature-section">
50
-		<h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?" , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>		
50
+		<h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?", 'yikes-inc-easy-mailchimp-extender' ); ?></h3>		
51 51
 		
52
-		<h4><?php _e( 'Free Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
53
-		<p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.",  'yikes-inc-easy-mailchimp-extender' ); ?></p>
52
+		<h4><?php _e( 'Free Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
53
+		<p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
54 54
 		<ul class="support-option-list">
55
-			<li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
56
-			<li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
55
+			<li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
56
+			<li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
57 57
 		</ul>
58 58
 		
59
-		<h4><?php _e( 'Priority Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
60
-		<p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
59
+		<h4><?php _e( 'Priority Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
60
+		<p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
61 61
 
62
-		<h4><?php _e( 'Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
63
-		<p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?>
62
+		<h4><?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
63
+		<p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?>
64 64
 		
65 65
 	</div>
66 66
 	
Please login to merge, or discard this patch.
admin/partials/welcome-page/welcome.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
 	 * @return void
8 8
 	 */
9 9
 	function yikes_easy_mc_welcome_tabs() {
10
-		$section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started';
10
+		$section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started';
11 11
 		?>
12 12
 		<h2 class="nav-tab-wrapper welcome-page-tabs">
13
-			<a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>">
13
+			<a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>">
14 14
 				<span class="dashicons dashicons-admin-home"></span> <?php _e( 'Getting Started', 'yikes-inc-easy-mailchimp-extender' ); ?>
15 15
 			</a>
16
-			<a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>">
16
+			<a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>">
17 17
 				<span class="dashicons dashicons-warning"></span> <?php _e( "What's New", 'yikes-inc-easy-mailchimp-extender' ); ?>
18 18
 			</a>
19
-			<a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>">
19
+			<a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>">
20 20
 				<span class="dashicons dashicons-admin-plugins"></span> <?php _e( "Add-Ons", 'yikes-inc-easy-mailchimp-extender' ); ?>
21 21
 			</a>
22
-			<a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>">
22
+			<a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>">
23 23
 				<span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>
24 24
 			</a>
25
-			<a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'credits' ), 'admin.php' ) ) ); ?>">
25
+			<a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'credits' ), 'admin.php' ) ) ); ?>">
26 26
 				<span class="dashicons dashicons-arrow-left-alt2"></span><?php _e( 'Credits', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span>
27 27
 			</a>
28 28
 		</h2>
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	}
31 31
 	
32 32
 	function yikes_easy_mc_welcome_body() {
33
-		$section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started';
34
-		if( isset( $section ) ) {
33
+		$section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started';
34
+		if ( isset( $section ) ) {
35 35
 			include_once( plugin_dir_path( dirname( __FILE__ ) ) . '/welcome-page/welcome-sections/' . $section . '-section.php' );
36 36
 		}
37 37
 	}
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
 		<div id="yikes-mailchimp-logo"></div>
45 45
 		
46 46
 		<h2 class="welcome-title">
47
-			Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?>
47
+			Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right', 'yikes-inc-easy-mailchimp-extender' ); ?>
48 48
 		</h2>		
49 49
 		
50 50
 		<p class="about-text">
51 51
 			<?php 
52 52
 				// check if this is a fresh install
53
-				if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
54
-					echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); 
53
+				if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
54
+					echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); 
55 55
 				} else {
56 56
 					// else thank you for updating :)
57
-					echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); 
57
+					echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); 
58 58
 				}
59 59
 			?>
60 60
 		</p>
Please login to merge, or discard this patch.
admin/partials/ajax/class.ajax.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -154,17 +154,17 @@
 block discarded – undo
154 154
 		public function findMCListIndex( $id, $array, $tag ) {
155 155
 			if( $tag == 'tag' ) {
156 156
 				foreach( $array as $key => $val ) {
157
-					   if ( $val['tag'] === $id ) {
158
-						   return $key;
159
-					   }
160
-				   }
161
-			   return null;
157
+						if ( $val['tag'] === $id ) {
158
+							return $key;
159
+						}
160
+					}
161
+				return null;
162 162
 			} else {
163 163
 				foreach ( $array as $key => $val ) {
164
-				   if ( $val['id'] == $id ) {
165
-					   return $key;
166
-				   }
167
-			   }
164
+					if ( $val['id'] == $id ) {
165
+						return $key;
166
+					}
167
+				}
168 168
 			return null;
169 169
 			}
170 170
 	  	} // end
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 
13 13
 		public function __construct() {				
14 14
 			// ajax send merge variable to form builder
15
-			add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 );
15
+			add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 );
16 16
 			// ajax send interest group to form builder
17
-			add_action( 'wp_ajax_add_interest_group_to_form', array( $this , 'send_interest_group_to_form' ), 10 );
17
+			add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 );
18 18
 			// return new list data + activity (for dashboard widget )
19
-			add_action( 'wp_ajax_get_new_list_data', array( $this , 'get_new_list_data' ), 10 );
19
+			add_action( 'wp_ajax_get_new_list_data', array( $this, 'get_new_list_data' ), 10 );
20 20
 			// return new list data + activity (for dashboard widget )
21
-			add_action( 'wp_ajax_check_list_for_interest_groups', array( $this , 'check_list_for_interest_groups' ), 10 );
21
+			add_action( 'wp_ajax_check_list_for_interest_groups', array( $this, 'check_list_for_interest_groups' ), 10 );
22 22
 			// Add a new notification to a form
23
-			add_action( 'wp_ajax_add_notification_to_form', array( $this , 'add_notification_to_form' ), 10 , 1 );
23
+			add_action( 'wp_ajax_add_notification_to_form', array( $this, 'add_notification_to_form' ), 10, 1 );
24 24
 		}
25 25
 		
26 26
 		/* 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		*	- return a single container
29 29
 		*/
30 30
 		public function add_notification_to_form() {
31
-			if( $_POST['notification_name'] ) {
31
+			if ( $_POST[ 'notification_name' ] ) {
32 32
 				include_once( YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php' );
33 33
 			}
34 34
 			exit();
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 		// when the user wants to switch which form data
40 40
 		// is displayed on the dashboard
41 41
 		public function get_new_list_data() {
42
-			$list_id = $_POST['list_id'];
43
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
42
+			$list_id = $_POST[ 'list_id' ];
43
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
44 44
 			$dash_position = strpos( $api_key, '-' );
45
-			if( $dash_position !== false ) {
45
+			if ( $dash_position !== false ) {
46 46
 				$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
47 47
 			}
48 48
 			$list_data = wp_remote_post( $api_endpoint, array( 
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 				'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
55 55
 			) );
56 56
 			$list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
57
-			if( isset( $list_data['error'] ) ) {
58
-				if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
57
+			if ( isset( $list_data[ 'error' ] ) ) {
58
+				if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
59 59
 					require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
60 60
 					$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
61
-					$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ) , __( "MailChimp Widget" , 'yikes-inc-easy-mailchimp-extender' ) );
61
+					$error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), __( "MailChimp Widget", 'yikes-inc-easy-mailchimp-extender' ) );
62 62
 				}
63 63
 			}
64
-			if( ! empty( $list_data['data'][0] ) ) {
64
+			if ( ! empty( $list_data[ 'data' ][ 0 ] ) ) {
65 65
 				include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' );
66 66
 			}
67 67
 			exit();
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
 		// we want to return the interest groups associated with this list,
74 74
 		// to allow users to pre-check anything they want to assign users appropriately
75 75
 		/* note: this function is called statically from the integration settings page */
76
-		public static function check_list_for_interest_groups( $list_id='', $integration_type='', $load=false ) {
77
-			if( ! $list_id ) { 	
78
-				$list_id = $_POST['list_id'];
76
+		public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) {
77
+			if ( ! $list_id ) { 	
78
+				$list_id = $_POST[ 'list_id' ];
79 79
 			}
80
-			if( ! $integration_type ) {	
81
-				$integration_type = $_POST['integration'];
80
+			if ( ! $integration_type ) {	
81
+				$integration_type = $_POST[ 'integration' ];
82 82
 			}
83
-			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
83
+			$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
84 84
 			// setup/check our transients
85
-			if ( WP_DEBUG ||  false === ( $interest_groupings = get_transient( $list_id . '_interest_group' ) ) ) {
85
+			if ( WP_DEBUG || false === ( $interest_groupings = get_transient( $list_id . '_interest_group' ) ) ) {
86 86
 			  // It wasn't there, so regenerate the data and save the transient		
87 87
 				$dash_position = strpos( $api_key, '-' );
88
-				if( $dash_position !== false ) {
88
+				if ( $dash_position !== false ) {
89 89
 					$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
90 90
 				}
91 91
 				$interest_groupings = wp_remote_post( $api_endpoint, array( 
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
 					'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
99 99
 				) );
100 100
 				$interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
101
-				if( isset( $interest_groupings['error'] ) ) {
102
-					if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
101
+				if ( isset( $interest_groupings[ 'error' ] ) ) {
102
+					if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
103 103
 						require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
104 104
 						$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
105
-						$error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" );
105
+						$error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" );
106 106
 					}
107 107
 				} else {
108 108
 					// set the transient for 2 hours
109 109
 					set_transient( $list_id . '_interest_group', $interest_groupings, 2 * HOUR_IN_SECONDS );
110 110
 				}
111 111
 			}
112
-			if( isset( $interest_groupings ) && ! empty( $interest_groupings ) ) {
112
+			if ( isset( $interest_groupings ) && ! empty( $interest_groupings ) ) {
113 113
 				require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' );
114 114
 			}
115 115
 			// do not kill off execution on load, only on an ajax request
116
-			if( ! $load ) {
116
+			if ( ! $load ) {
117 117
 				exit();
118 118
 				wp_die();
119 119
 			}
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 		// send a field to our form
124 124
 		public function send_field_to_form() {
125 125
 			$form_data_array = array(
126
-				'field_name' => $_POST['field_name'],
127
-				'merge_tag' => $_POST['merge_tag'],
128
-				'field_type' => $_POST['field_type'],
129
-				'list_id' => $_POST['list_id'],
126
+				'field_name' => $_POST[ 'field_name' ],
127
+				'merge_tag' => $_POST[ 'merge_tag' ],
128
+				'field_type' => $_POST[ 'field_type' ],
129
+				'list_id' => $_POST[ 'list_id' ],
130 130
 			);
131 131
 			include YIKES_MC_PATH . 'admin/partials/ajax/add_field_to_form.php';
132 132
 			exit();
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 		// send interest group to our form
137 137
 		public function send_interest_group_to_form() {
138 138
 			$form_data_array = array(
139
-				'field_name' => $_POST['field_name'],
140
-				'group_id' => $_POST['group_id'],
141
-				'field_type' => $_POST['field_type'],
142
-				'list_id' => $_POST['list_id'],
139
+				'field_name' => $_POST[ 'field_name' ],
140
+				'group_id' => $_POST[ 'group_id' ],
141
+				'field_type' => $_POST[ 'field_type' ],
142
+				'list_id' => $_POST[ 'list_id' ],
143 143
 			);
144 144
 			include YIKES_MC_PATH . 'admin/partials/ajax/add_interest_group_to_form.php';
145 145
 			exit();
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
 		*	- http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
153 153
 		*/
154 154
 		public function findMCListIndex( $id, $array, $tag ) {
155
-			if( $tag == 'tag' ) {
156
-				foreach( $array as $key => $val ) {
157
-					   if ( $val['tag'] === $id ) {
155
+			if ( $tag == 'tag' ) {
156
+				foreach ( $array as $key => $val ) {
157
+					   if ( $val[ 'tag' ] === $id ) {
158 158
 						   return $key;
159 159
 					   }
160 160
 				   }
161 161
 			   return null;
162 162
 			} else {
163 163
 				foreach ( $array as $key => $val ) {
164
-				   if ( $val['id'] == $id ) {
164
+				   if ( $val[ 'id' ] == $id ) {
165 165
 					   return $key;
166 166
 				   }
167 167
 			   }
Please login to merge, or discard this patch.
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,10 +7,9 @@  discard block
 block discarded – undo
7 7
 	*	@since 6.0.0
8 8
 	*	Author: Yikes Inc. | https://www.yikesinc.com
9 9
 	*/
10
-	class YIKES_Inc_Easy_MailChimp_Process_Ajax
11
-	{
10
+	class YIKES_Inc_Easy_MailChimp_Process_Ajax {
12 11
 
13
-		public function __construct() {				
12
+		public function __construct() {
14 13
 			// ajax send merge variable to form builder
15 14
 			add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 );
16 15
 			// ajax send interest group to form builder
@@ -74,10 +73,10 @@  discard block
 block discarded – undo
74 73
 		// to allow users to pre-check anything they want to assign users appropriately
75 74
 		/* note: this function is called statically from the integration settings page */
76 75
 		public static function check_list_for_interest_groups( $list_id='', $integration_type='', $load=false ) {
77
-			if( ! $list_id ) { 	
76
+			if( ! $list_id ) {
78 77
 				$list_id = $_POST['list_id'];
79 78
 			}
80
-			if( ! $integration_type ) {	
79
+			if( ! $integration_type ) {
81 80
 				$integration_type = $_POST['integration'];
82 81
 			}
83 82
 			$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
Please login to merge, or discard this patch.
admin/partials/ajax/add_field_to_form.php 2 patches
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 	// lets run an ajax request to get all of our field data, to either prepopulate
3 3
 	// or build our default selection arrays etc.
4
-	$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
4
+	$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
5 5
 	$dash_position = strpos( $api_key, '-' );
6
-	if( $dash_position !== false ) {
6
+	if ( $dash_position !== false ) {
7 7
 		$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
8 8
 	}
9 9
 	$available_merge_variables = wp_remote_post( $api_endpoint, array( 
10 10
 		'body' => array( 
11 11
 			'apikey' => $api_key, 
12
-			'id' => array( $form_data_array['list_id'] ),
12
+			'id' => array( $form_data_array[ 'list_id' ] ),
13 13
 		),
14 14
 		'timeout' => 10,
15 15
 		'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
16 16
 	) );
17 17
 	$body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
18
-	if( isset( $body['error'] ) ) {
19
-		if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
18
+	if ( isset( $body[ 'error' ] ) ) {
19
+		if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
20 20
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
21 21
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $body['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Add Field to Form" , 'yikes-inc-easy-mailchimp-extender' ) );
22
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $body[ 'error' ], __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ), __( "Add Field to Form", 'yikes-inc-easy-mailchimp-extender' ) );
23 23
 		}
24 24
 		?>
25 25
 			<section class="draggable" id="error-container">
26
-				<p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $body['error'] ); ?></p>
26
+				<p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $body[ 'error' ] ); ?></p>
27 27
 			</section>
28 28
 		<?php 
29 29
 		return;
30 30
 	}
31 31
 	// find and return the location of this merge field in the array
32
-	$index = $this->findMCListIndex( $form_data_array['merge_tag'] , $body['data'][0]['merge_vars'], 'tag' );
32
+	$index = $this->findMCListIndex( $form_data_array[ 'merge_tag' ], $body[ 'data' ][ 0 ][ 'merge_vars' ], 'tag' );
33 33
 	// store it and use it to pre-populate field data (only on initial add to form)
34
-	$merge_field_data = $body['data'][0]['merge_vars'][$index];
34
+	$merge_field_data = $body[ 'data' ][ 0 ][ 'merge_vars' ][ $index ];
35 35
 ?>
36
-<section class="draggable" id="<?php echo $form_data_array['field_name']; ?>">
36
+<section class="draggable" id="<?php echo $form_data_array[ 'field_name' ]; ?>">
37 37
 	<!-- top -->
38 38
 	<a href="#" class="expansion-section-title settings-sidebar">
39
-		<span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array['field_name'] ); ?>
40
-		<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
39
+		<span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array[ 'field_name' ] ); ?>
40
+		<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array[ 'field_type' ]; ?></small></span>
41 41
 	</a>
42 42
 	<!-- expansion section -->
43 43
 	<div class="yikes-mc-settings-expansion-section">
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 		<!-- Single or Double Opt-in -->
46 46
 		<p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
47 47
 			<!-- store the label -->
48
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
49
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
50
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
51
-			<input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
48
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][label]" value="<?php echo $form_data_array[ 'field_name' ]; ?>" />
49
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][type]" value="<?php echo $form_data_array[ 'field_type' ]; ?>" />
50
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][merge]" value="<?php echo $merge_field_data[ 'tag' ]; ?>" />
51
+			<input type="hidden" class="field-<?php echo $merge_field_data[ 'tag' ]; ?>-position position-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][position]" value="" />
52 52
 			
53
-			<?php if ( $form_data_array['field_type'] == 'radio' || $form_data_array['field_type'] == 'dropdown' ) { ?>
54
-				<?php $choices = ( isset( $merge_field_data['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['choices'] ) ) : ''; ?>
55
-				<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' />
53
+			<?php if ( $form_data_array[ 'field_type' ] == 'radio' || $form_data_array[ 'field_type' ] == 'dropdown' ) { ?>
54
+				<?php $choices = ( isset( $merge_field_data[ 'choices' ] ) ) ? esc_attr( json_encode( $merge_field_data[ 'choices' ] ) ) : ''; ?>
55
+				<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][choices]" value='<?php echo $choices; ?>' />
56 56
 			<?php } ?>
57 57
 				
58 58
 			<table class="form-table form-field-container">
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
 					<tr valign="top">
62 62
 						<td scope="row">
63 63
 							<label for="merge-tag">
64
-								<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
64
+								<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
65 65
 							</label>
66 66
 						</td>
67 67
 						<td>
68
-							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data['tag']; ?>">
68
+							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data[ 'tag' ]; ?>">
69 69
 						</td>
70 70
 					</tr>
71 71
 
72
-			<?php switch( $form_data_array['field_type'] ) {
72
+			<?php switch ( $form_data_array[ 'field_type' ] ) {
73 73
 					
74 74
 					default:
75 75
 						break;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 					<tr valign="top">
88 88
 						<td scope="row">
89 89
 							<label for="placeholder">
90
-								<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?> 
90
+								<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?> 
91 91
 							</label>
92 92
 						</td>
93 93
 						<td>
94
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ): '' ; ?>" />
95
-							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
94
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="<?php echo isset( $merge_field_data[ 'placeholder' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'placeholder' ] ) ) : ''; ?>" />
95
+							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
96 96
 						</td>
97 97
 					</tr>
98 98
 			
@@ -101,27 +101,27 @@  discard block
 block discarded – undo
101 101
 					*	Loop over field types and store necessary formats
102 102
 					*	( date, birthday - dateformat ; phone - phoneformat )
103 103
 					*/
104
-					switch( $form_data_array['field_type'] ) {
104
+					switch ( $form_data_array[ 'field_type' ] ) {
105 105
 												
106 106
 						/* Store the date format, for properly rendering dates on the front end */
107 107
 						case 'date':
108
-							$date_format = ( isset( $merge_field_data['dateformat'] ) ) ? $merge_field_data['dateformat'] : 'MM/DD/YYYY';
108
+							$date_format = ( isset( $merge_field_data[ 'dateformat' ] ) ) ? $merge_field_data[ 'dateformat' ] : 'MM/DD/YYYY';
109 109
 							?>
110
-								<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $merge_field_data['dateformat'] ); ?>" />
110
+								<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $merge_field_data[ 'dateformat' ] ); ?>" />
111 111
 							<?php
112 112
 						break;
113 113
 						
114 114
 						case 'birthday':
115
-							$date_format = ( isset( $merge_field_data['dateformat'] ) ) ? $merge_field_data['dateformat'] : 'MM/DD';
115
+							$date_format = ( isset( $merge_field_data[ 'dateformat' ] ) ) ? $merge_field_data[ 'dateformat' ] : 'MM/DD';
116 116
 							?>
117
-								<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
117
+								<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
118 118
 							<?php
119 119
 						break;
120 120
 						
121 121
 						/* Store the phone format, for properly regex pattern */
122 122
 						case 'phone':
123 123
 							?>
124
-								<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['phoneformat']; ?>" />
124
+								<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][phone_format]" value="<?php echo $merge_field_data[ 'phoneformat' ]; ?>" />
125 125
 							<?php
126 126
 						break;
127 127
 					}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			?>
133 133
 			
134 134
 				<!-- Default Value -->
135
-				<?php switch( $form_data_array['field_type'] ) { 
135
+				<?php switch ( $form_data_array[ 'field_type' ] ) { 
136 136
 						
137 137
 						default:
138 138
 						case 'text':
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 							<tr valign="top">
141 141
 								<td scope="row">
142 142
 									<label for="placeholder">
143
-										<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
143
+										<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
144 144
 									</label>
145 145
 								</td>
146 146
 							<td>
147
-								<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" />
148
-								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
147
+								<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default]" <?php if ( $form_data_array[ 'field_type' ] != 'url' ) { ?> value="<?php echo isset( $merge_field_data[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data[ 'default' ] ) ) ) : ''; } ?>" />
148
+								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
149 149
 								<?php 
150
-								switch( $form_data_array['field_type'] ) { 
150
+								switch ( $form_data_array[ 'field_type' ] ) { 
151 151
 									case 'text':
152 152
 										?>
153
-											<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
153
+											<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
154 154
 										<?php
155 155
 									break;
156 156
 								} ?>
@@ -164,20 +164,20 @@  discard block
 block discarded – undo
164 164
 							<tr valign="top">
165 165
 								<td scope="row">
166 166
 									<label for="placeholder">
167
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
167
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
168 168
 									</label>
169 169
 								</td>
170 170
 								<td>
171 171
 									<?php 
172 172
 										$x = 0;
173
-										foreach( $merge_field_data['choices'] as $choice => $value ) { 
174
-											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
173
+										foreach ( $merge_field_data[ 'choices' ] as $choice => $value ) { 
174
+											$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
175 175
 									?>
176 176
 										<label>
177
-											<input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo $value; ?>
177
+											<input type="radio" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
178 178
 										</label>
179 179
 									<?php $x++; } ?>
180
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
180
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
181 181
 								</td>
182 182
 							</tr>
183 183
 											
@@ -189,18 +189,18 @@  discard block
 block discarded – undo
189 189
 							<tr valign="top">
190 190
 								<td scope="row">
191 191
 									<label for="placeholder">
192
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
192
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
193 193
 									</label>
194 194
 								</td>
195 195
 								<td>
196
-									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
197
-										<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
198
-												$pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
196
+									<select type="default" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]">
197
+										<?php foreach ( $merge_field_data[ 'choices' ] as $choice => $value ) { 
198
+												$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
199 199
 										?>
200
-											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
200
+											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option>
201 201
 										<?php } ?>
202 202
 									</select>
203
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
203
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
204 204
 								</td>
205 205
 							</tr>
206 206
 									
@@ -214,65 +214,65 @@  discard block
 block discarded – undo
214 214
 				<tr valign="top">
215 215
 					<td scope="row">
216 216
 						<label for="placeholder">
217
-							<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
217
+							<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
218 218
 						</label>
219 219
 					</td>
220 220
 					<td>
221
-						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description]"></textarea>
222
-						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
221
+						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description]"></textarea>
222
+						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
223 223
 					</td>
224 224
 				</tr>
225 225
 				<!-- Additional Classes -->
226 226
 				<tr valign="top">
227 227
 					<td scope="row">
228 228
 						<label for="placeholder">
229
-							<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
229
+							<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
230 230
 						</label>
231 231
 					</td>
232 232
 					<td>
233
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data_array['classes'] ) ) : '' ; ?>" />
234
-						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
233
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][additional-classes]" value="<?php echo isset( $form_data_array[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data_array[ 'classes' ] ) ) : ''; ?>" />
234
+						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
235 235
 					</td>
236 236
 				</tr>
237 237
 					<!-- Required Toggle -->
238 238
 					<tr valign="top">
239 239
 						<td scope="row">
240 240
 							<label for="field-required">
241
-								<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
241
+								<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
242 242
 							</label>
243 243
 						</td>
244 244
 						<td>
245
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['req'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
246
-							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
245
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][require]" <?php checked( $merge_field_data[ 'req' ], 1 ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
246
+							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
247 247
 						</td>
248 248
 					</tr>
249 249
 					<!-- Visible Toggle -->
250 250
 					<tr valign="top">
251 251
 						<td scope="row">
252 252
 							<label for="hide-field">
253
-								<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
253
+								<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
254 254
 							</label>
255 255
 						</td>
256 256
 						<td>
257
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php checked( $merge_field_data['public'], '' ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
258
-							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
257
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide]" <?php checked( $merge_field_data[ 'public' ], '' ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
258
+							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
259 259
 						</td>
260 260
 					</tr>
261 261
 					<!-- Toggle Field Label Visibility -->
262 262
 					<tr valign="top">
263 263
 						<td scope="row">
264 264
 							<label for="placeholder">
265
-								<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
265
+								<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
266 266
 							</label>
267 267
 						</td>
268 268
 						<td>
269
-							<input type="checkbox" name="field[<?php echo $merge_field_data['tag']; ?>][hide-label]" value="1" />
270
-							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
269
+							<input type="checkbox" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide-label]" value="1" />
270
+							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
271 271
 						</td>
272 272
 					</tr>
273 273
 					<!-- Display Phone/Date Formats back to the user -->
274 274
 					<?php 
275
-						switch( $form_data_array['field_type'] ) {
275
+						switch ( $form_data_array[ 'field_type' ] ) {
276 276
 							
277 277
 							/* Store the phone format, for properly regex pattern */
278 278
 							case 'phone':
@@ -283,23 +283,23 @@  discard block
 block discarded – undo
283 283
 									<td scope="row">
284 284
 										<label for="placeholder">		
285 285
 										<?php 
286
-											switch( $form_data_array['field_type'] ) {
286
+											switch ( $form_data_array[ 'field_type' ] ) {
287 287
 												default:
288 288
 												case 'birthday':
289
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
290
-													$format = $merge_field_data['dateformat'];
289
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
290
+													$format = $merge_field_data[ 'dateformat' ];
291 291
 													$format_name = 'date_format';
292 292
 													break;
293 293
 													
294 294
 												case 'date':
295
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
296
-													$format = $merge_field_data['dateformat'];
295
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
296
+													$format = $merge_field_data[ 'dateformat' ];
297 297
 													$format_name = 'date_format';
298 298
 													break;
299 299
 																				
300 300
 												case 'phone':
301
-													$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
302
-													$format = ( ( $merge_field_data['phoneformat'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['phoneformat'] );
301
+													$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
302
+													$format = ( ( $merge_field_data[ 'phoneformat' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data[ 'phoneformat' ] );
303 303
 													$format_name = 'phone_format';
304 304
 													break;
305 305
 											}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 									</td>
310 310
 									<td>
311 311
 										<strong><?php echo $format; ?></strong>
312
-										<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
312
+										<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
313 313
 										<p class="description"><small>
314 314
 											<?php printf( __( 'To change the %s please head over to <a href="%s" title="MailChimp" target="_blank">MailChimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?>
315 315
 										</small></p>
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 						</td>
331 331
 						<td>
332 332
 							<span class="toggle-container">
333
-								<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
334
-								<a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
333
+								<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
334
+								<a href="#" class="remove-field" alt="<?php echo $merge_field_data[ 'tag' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
335 335
 							</span>
336 336
 						</td>
337 337
 					</tr>
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			?>
133 133
 			
134 134
 				<!-- Default Value -->
135
-				<?php switch( $form_data_array['field_type'] ) { 
135
+				<?php switch( $form_data_array['field_type'] ) {
136 136
 						
137 137
 						default:
138 138
 						case 'text':
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 								<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" />
148 148
 								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
149 149
 								<?php 
150
-								switch( $form_data_array['field_type'] ) { 
150
+								switch( $form_data_array['field_type'] ) {
151 151
 									case 'text':
152 152
 										?>
153 153
 											<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 								<td>
171 171
 									<?php 
172 172
 										$x = 0;
173
-										foreach( $merge_field_data['choices'] as $choice => $value ) { 
173
+										foreach( $merge_field_data['choices'] as $choice => $value ) {
174 174
 											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
175 175
 									?>
176 176
 										<label>
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 								</td>
195 195
 								<td>
196 196
 									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
197
-										<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
197
+										<?php foreach( $merge_field_data['choices'] as $choice => $value ) {
198 198
 												$pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
199 199
 										?>
200 200
 											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
Please login to merge, or discard this patch.
admin/partials/ajax/process_ajax.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@  discard block
 block discarded – undo
8 8
 	*	@since 6.0.0
9 9
 	*	Author: Yikes Inc. | https://www.yikesinc.com
10 10
 	*/
11
-	$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
11
+	$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
12 12
 	$dash_position = strpos( $api_key, '-' );
13
-	if( $dash_position !== false ) {
13
+	if ( $dash_position !== false ) {
14 14
 		$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
15 15
 	}
16 16
 	$available_merge_variables = wp_remote_post( $api_endpoint, array( 
17 17
 		'body' => array( 
18 18
 			'apikey' => $api_key, 
19
-			'id' => array( $form_data_array['list_id'] ),
19
+			'id' => array( $form_data_array[ 'list_id' ] ),
20 20
 		),
21 21
 		'timeout' => 10,
22 22
 		'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) 
23 23
 	) );
24 24
 	$body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
25
-	if( isset( $body['error'] ) ) {	
26
-		if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
25
+	if ( isset( $body[ 'error' ] ) ) {	
26
+		if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
27 27
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
28 28
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
29
-			$error_logging->yikes_easy_mailchimp_write_to_error_log( $body['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "process_ajax.php" );
29
+			$error_logging->yikes_easy_mailchimp_write_to_error_log( $body[ 'error' ], __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ), "process_ajax.php" );
30 30
 		}
31 31
 	}
32 32
 	// find and return the location of this merge field in the array
33
-	$index = $this->findMCListIndex( $form_data_array['merge_tag'] , $body['data'][0]['merge_vars'], 'tag' );
33
+	$index = $this->findMCListIndex( $form_data_array[ 'merge_tag' ], $body[ 'data' ][ 0 ][ 'merge_vars' ], 'tag' );
34 34
 	// store it and use it to pre-populate field data (only on initial add to form)
35
-	$merge_field_data = $body['data'][0]['merge_vars'][$index];
35
+	$merge_field_data = $body[ 'data' ][ 0 ][ 'merge_vars' ][ $index ];
36 36
 ?>
37
-<section class="draggable" id="<?php echo $form_data_array['field_name']; ?>">
37
+<section class="draggable" id="<?php echo $form_data_array[ 'field_name' ]; ?>">
38 38
 	<!-- top -->
39 39
 	<a href="#" class="expansion-section-title settings-sidebar">
40
-		<span class="dashicons dashicons-plus"></span><?php echo $form_data_array['field_name']; ?>
41
-		<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
40
+		<span class="dashicons dashicons-plus"></span><?php echo $form_data_array[ 'field_name' ]; ?>
41
+		<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array[ 'field_type' ]; ?></small></span>
42 42
 	</a>
43 43
 	<!-- expansion section -->
44 44
 	<div class="yikes-mc-settings-expansion-section">
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 		<!-- Single or Double Opt-in -->
47 47
 		<p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
48 48
 			<!-- store the label -->
49
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
50
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
51
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
52
-			<input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
49
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][label]" value="<?php echo $form_data_array[ 'field_name' ]; ?>" />
50
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][type]" value="<?php echo $form_data_array[ 'field_type' ]; ?>" />
51
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][merge]" value="<?php echo $merge_field_data[ 'tag' ]; ?>" />
52
+			<input type="hidden" class="field-<?php echo $merge_field_data[ 'tag' ]; ?>-position position-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][position]" value="" />
53 53
 			
54
-			<?php if ( $form_data_array['field_type'] == 'radio' || $form_data_array['field_type'] == 'dropdown' ) { ?>
55
-				<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo stripslashes( json_encode( $merge_field_data['choices'] ) ); ?>' />
54
+			<?php if ( $form_data_array[ 'field_type' ] == 'radio' || $form_data_array[ 'field_type' ] == 'dropdown' ) { ?>
55
+				<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][choices]" value='<?php echo stripslashes( json_encode( $merge_field_data[ 'choices' ] ) ); ?>' />
56 56
 			<?php } ?>
57 57
 				
58 58
 			<table class="form-table form-field-container">
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 				<tr valign="top">
61 61
 					<td scope="row">
62 62
 						<label for="placeholder">
63
-							<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
63
+							<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
64 64
 						</label>
65 65
 					</td>
66 66
 					<td>
67
-					<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ) : '' ; ?>" />
68
-						<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
67
+					<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="<?php echo isset( $merge_field_data[ 'placeholder' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'placeholder' ] ) ) : ''; ?>" />
68
+						<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
69 69
 					</td>
70 70
 				</tr>
71 71
 				<!-- Default Value -->
72
-				<?php switch( $form_data_array['field_type'] ) { 
72
+				<?php switch ( $form_data_array[ 'field_type' ] ) { 
73 73
 						
74 74
 						default:
75 75
 						case 'text':
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 							<tr valign="top">
78 78
 								<td scope="row">
79 79
 									<label for="placeholder">
80
-										<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
80
+										<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
81 81
 									</label>
82 82
 								</td>
83 83
 							<td>
84
-								<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" />
85
-								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
84
+								<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default]" <?php if ( $form_data_array[ 'field_type' ] != 'url' ) { ?> value="<?php echo isset( $merge_field_data[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data[ 'default' ] ) ) ) : ''; } ?>" />
85
+								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
86 86
 							</td>
87 87
 							</tr>
88 88
 						<?php 
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 							<tr valign="top">
94 94
 								<td scope="row">
95 95
 									<label for="placeholder">
96
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
96
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
97 97
 									</label>
98 98
 								</td>
99 99
 								<td>
100
-									<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
101
-											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
100
+									<?php foreach ( $merge_field_data[ 'choices' ] as $choice => $value ) { 
101
+											$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
102 102
 									?>
103
-										<input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $choice; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?>
103
+										<input type="radio" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]" value="<?php echo $choice; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?>
104 104
 									<?php } ?>
105
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
105
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
106 106
 								</td>
107 107
 							</tr>
108 108
 											
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 							<tr valign="top">
115 115
 								<td scope="row">
116 116
 									<label for="placeholder">
117
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
117
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
118 118
 									</label>
119 119
 								</td>
120 120
 								<td>
121
-									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
122
-										<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
123
-												$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
121
+									<select type="default" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]">
122
+										<?php foreach ( $merge_field_data[ 'choices' ] as $choice => $value ) { 
123
+												$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
124 124
 										?>
125
-											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
125
+											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option>
126 126
 										<?php } ?>
127 127
 									</select>
128
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
128
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
129 129
 								</td>
130 130
 							</tr>
131 131
 									
@@ -139,36 +139,36 @@  discard block
 block discarded – undo
139 139
 				<tr valign="top">
140 140
 					<td scope="row">
141 141
 						<label for="placeholder">
142
-							<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
142
+							<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
143 143
 						</label>
144 144
 					</td>
145 145
 					<td>
146
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( esc_html( $form_data_array['classes'] ) ) : '' ; ?>" />
147
-						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
146
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][additional-classes]" value="<?php echo isset( $form_data_array[ 'classes' ] ) ? stripslashes( esc_html( $form_data_array[ 'classes' ] ) ) : ''; ?>" />
147
+						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
148 148
 					</td>
149 149
 					</tr>
150 150
 					<!-- Required Toggle -->
151 151
 					<tr valign="top">
152 152
 						<td scope="row">
153 153
 							<label for="field-required">
154
-								<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
154
+								<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
155 155
 							</label>
156 156
 						</td>
157 157
 						<td>
158
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['req'] , 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
159
-							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
158
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][require]" <?php checked( $merge_field_data[ 'req' ], 1 ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
159
+							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
160 160
 						</td>
161 161
 					</tr>
162 162
 					<!-- Visible Toggle -->
163 163
 					<tr valign="top">
164 164
 						<td scope="row">
165 165
 							<label for="hide-field">
166
-								<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
166
+								<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
167 167
 							</label>
168 168
 						</td>
169 169
 						<td>
170
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php if( empty( $merge_field_data['show'] ) ) { echo 'checked="checked"'; } ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
171
-							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
170
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide]" <?php if ( empty( $merge_field_data[ 'show' ] ) ) { echo 'checked="checked"'; } ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
171
+							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
172 172
 						</td>
173 173
 					</tr>
174 174
 					<!-- Toggle Buttons -->
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 						</td>
179 179
 						<td>
180 180
 							<span class="toggle-container">
181
-								<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
182
-								<a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
181
+								<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
182
+								<a href="#" class="remove-field" alt="<?php echo $merge_field_data[ 'tag' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
183 183
 							</span>
184 184
 						</td>
185 185
 					</tr>
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) 
23 23
 	) );
24 24
 	$body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
25
-	if( isset( $body['error'] ) ) {	
25
+	if( isset( $body['error'] ) ) {
26 26
 		if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
27 27
 			require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
28 28
 			$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 					</td>
70 70
 				</tr>
71 71
 				<!-- Default Value -->
72
-				<?php switch( $form_data_array['field_type'] ) { 
72
+				<?php switch( $form_data_array['field_type'] ) {
73 73
 						
74 74
 						default:
75 75
 						case 'text':
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 									</label>
98 98
 								</td>
99 99
 								<td>
100
-									<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
100
+									<?php foreach( $merge_field_data['choices'] as $choice => $value ) {
101 101
 											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
102 102
 									?>
103 103
 										<input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $choice; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?>
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 								</td>
120 120
 								<td>
121 121
 									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
122
-										<?php foreach( $merge_field_data['choices'] as $choice => $value ) { 
122
+										<?php foreach( $merge_field_data['choices'] as $choice => $value ) {
123 123
 												$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
124 124
 										?>
125 125
 											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
Please login to merge, or discard this patch.
admin/partials/ajax/add_interest_group_to_form.php 2 patches
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	$api_key = trim( get_option( 'yikes-mc-api-key' , '' ) );
2
+	$api_key = trim( get_option( 'yikes-mc-api-key', '' ) );
3 3
 	$dash_position = strpos( $api_key, '-' );
4
-	if( $dash_position !== false ) {
4
+	if ( $dash_position !== false ) {
5 5
 		$api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
6 6
 	}
7 7
 	// get the interest group data
8 8
 	$interest_groupings = wp_remote_post( $api_endpoint, array( 
9 9
 		'body' => array( 
10 10
 			'apikey' => $api_key, 
11
-			'id' => $form_data_array['list_id'] 
11
+			'id' => $form_data_array[ 'list_id' ] 
12 12
 		),
13 13
 		'timeout' => 10,
14 14
 		'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) 
15 15
 	) );
16 16
 	$interest_groupings_body = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
17
-	if( ! is_wp_error( $interest_groupings_body ) ) {
18
-		if( isset( $interest_groupings_body['error'] ) ) {
19
-			if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
17
+	if ( ! is_wp_error( $interest_groupings_body ) ) {
18
+		if ( isset( $interest_groupings_body[ 'error' ] ) ) {
19
+			if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
20 20
 				require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
21 21
 				$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
-				$error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings_body['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Add Interest Group to Form" , 'yikes-inc-easy-mailchimp-extender' ) );
22
+				$error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings_body[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), __( "Add Interest Group to Form", 'yikes-inc-easy-mailchimp-extender' ) );
23 23
 			}
24 24
 			?>
25 25
 			<section class="draggable" id="error-container">
26
-				<p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $interest_groupings_body['error'] ); ?></p>
26
+				<p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $interest_groupings_body[ 'error' ] ); ?></p>
27 27
 			</section>
28 28
 			<?php 
29 29
 			return;
30 30
 		}
31 31
 		// find and return the location of this merge field in the array
32
-		$index = $this->findMCListIndex( $form_data_array['group_id'], $interest_groupings_body, 'id' );
32
+		$index = $this->findMCListIndex( $form_data_array[ 'group_id' ], $interest_groupings_body, 'id' );
33 33
 		// check for our index...
34
-		if( isset( $index) ) {
34
+		if ( isset( $index ) ) {
35 35
 			// store it and use it to pre-populate field data (only on initial add to form)
36
-			$merge_field_data = $interest_groupings_body[$index];
36
+			$merge_field_data = $interest_groupings_body[ $index ];
37 37
 		}
38 38
 	}			
39 39
 
40 40
 ?>
41
-<section class="draggable" id="<?php echo $form_data_array['group_id']; ?>">
41
+<section class="draggable" id="<?php echo $form_data_array[ 'group_id' ]; ?>">
42 42
 	<!-- top -->
43 43
 	<a href="#" class="expansion-section-title settings-sidebar">
44
-		<span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array['field_name'] ); ?>
45
-		<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
44
+		<span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array[ 'field_name' ] ); ?>
45
+		<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array[ 'field_type' ]; ?></small></span>
46 46
 	</a>
47 47
 	<!-- expansion section -->
48 48
 	<div class="yikes-mc-settings-expansion-section">
@@ -50,16 +50,16 @@  discard block
 block discarded – undo
50 50
 		<!-- Single or Double Opt-in -->
51 51
 		<p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
52 52
 			<!-- store the label -->
53
-			<input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
54
-			<input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
55
-			<input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][group_id]" value="<?php echo $form_data_array['group_id']; ?>" />
56
-			<input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][groups]" value='<?php echo str_replace( '\'' , '~' , json_encode( $merge_field_data['groups'] ) ); ?>' />
53
+			<input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][label]" value="<?php echo $form_data_array[ 'field_name' ]; ?>" />
54
+			<input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][type]" value="<?php echo $form_data_array[ 'field_type' ]; ?>" />
55
+			<input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][group_id]" value="<?php echo $form_data_array[ 'group_id' ]; ?>" />
56
+			<input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][groups]" value='<?php echo str_replace( '\'', '~', json_encode( $merge_field_data[ 'groups' ] ) ); ?>' />
57 57
 	
58 58
 				
59 59
 			<table class="form-table form-field-container">
60 60
 			
61 61
 				<!-- Default Value -->
62
-				<?php switch( $form_data_array['field_type'] ) { 
62
+				<?php switch ( $form_data_array[ 'field_type' ] ) { 
63 63
 						
64 64
 						default:
65 65
 						case 'radio':
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
 							<tr valign="top">
68 68
 								<td scope="row">
69 69
 									<label for="placeholder">
70
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
70
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
71 71
 									</label>
72 72
 								</td>
73 73
 								<td>
74
-									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
75
-											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
74
+									<?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { 
75
+											$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
76 76
 									?>
77
-										<input type="radio" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
77
+										<input type="radio" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected, $i ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?>
78 78
 									<?php 
79 79
 										$i++;
80 80
 										} 
81 81
 									?>
82
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
82
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
83 83
 								</td>
84 84
 							</tr>
85 85
 											
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 							<tr valign="top">
92 92
 								<td scope="row">
93 93
 									<label for="placeholder">
94
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
94
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
95 95
 									</label>
96 96
 								</td>
97 97
 								<td>
98
-									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
99
-											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
98
+									<?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { 
99
+											$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
100 100
 									?>
101
-										<input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
101
+										<input type="checkbox" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected, $i ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?>
102 102
 									<?php 
103 103
 										$i++;
104 104
 										} 
105 105
 									?>
106
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
106
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
107 107
 								</td>
108 108
 							</tr>
109 109
 											
@@ -115,18 +115,18 @@  discard block
 block discarded – undo
115 115
 							<tr valign="top">
116 116
 								<td scope="row">
117 117
 									<label for="placeholder">
118
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
118
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
119 119
 									</label>
120 120
 								</td>
121 121
 								<td>
122
-									<select type="default" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice]">
123
-										<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
124
-												$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
122
+									<select type="default" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice]">
123
+										<?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { 
124
+												$pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0';
125 125
 										?>
126
-											<option value="<?php echo $i; ?>" <?php selected( $pre_selected , $i ); ?>><?php echo $interest_group['name']; ?></option>
126
+											<option value="<?php echo $i; ?>" <?php selected( $pre_selected, $i ); ?>><?php echo $interest_group[ 'name' ]; ?></option>
127 127
 										<?php $i++; } ?>
128 128
 									</select>
129
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
129
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
130 130
 								</td>
131 131
 							</tr>
132 132
 									
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
 				<tr valign="top">
141 141
 					<td scope="row">
142 142
 						<label for="placeholder">
143
-							<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
143
+							<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
144 144
 						</label>
145 145
 					</td>
146 146
 					<td>
147
-						<textarea class="widefat field-description-input" name="field[<?php echo $form_data_array['group_id']; ?>][description]"></textarea>
148
-						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
147
+						<textarea class="widefat field-description-input" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][description]"></textarea>
148
+						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
149 149
 					</td>
150 150
 				</tr>
151 151
 				
@@ -153,48 +153,48 @@  discard block
 block discarded – undo
153 153
 				<tr valign="top">
154 154
 					<td scope="row">
155 155
 						<label for="placeholder">
156
-							<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
156
+							<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
157 157
 						</label>
158 158
 					</td>
159 159
 					<td>
160
-						<input type="text" class="widefat" name="field[<?php echo $form_data_array['group_id']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data_array['classes'] ) ) : '' ; ?>" />
161
-						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
160
+						<input type="text" class="widefat" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $form_data_array[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data_array[ 'classes' ] ) ) : ''; ?>" />
161
+						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
162 162
 					</td>
163 163
 					</tr>
164 164
 					<!-- Required Toggle -->
165 165
 					<tr valign="top">
166 166
 						<td scope="row">
167 167
 							<label for="field-required">
168
-								<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
168
+								<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
169 169
 							</label>
170 170
 						</td>
171 171
 						<td>
172
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][require]">
173
-							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
172
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][require]">
173
+							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
174 174
 						</td>
175 175
 					</tr>
176 176
 					<!-- Visible Toggle -->
177 177
 					<tr valign="top">
178 178
 						<td scope="row">
179 179
 							<label for="hide-field">
180
-								<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
180
+								<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
181 181
 							</label>
182 182
 						</td>
183 183
 						<td>
184
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][hide]">
185
-							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
184
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][hide]">
185
+							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
186 186
 						</td>
187 187
 					</tr>
188 188
 					<!-- Toggle Field Label Visibility -->
189 189
 					<tr valign="top">
190 190
 						<td scope="row">
191 191
 							<label for="placeholder">
192
-								<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
192
+								<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
193 193
 							</label>
194 194
 						</td>
195 195
 						<td>
196
-							<input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][hide-label]" value="1" />
197
-							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
196
+							<input type="checkbox" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][hide-label]" value="1" />
197
+							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
198 198
 						</td>
199 199
 					</tr>
200 200
 					<!-- Toggle Buttons -->
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 						</td>
205 205
 						<td>
206 206
 							<span class="toggle-container">
207
-								<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
208
-								<a href="#" class="remove-field" alt="<?php echo $form_data_array['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
207
+								<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
208
+								<a href="#" class="remove-field" alt="<?php echo $form_data_array[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
209 209
 							</span>
210 210
 						</td>
211 211
 					</tr>
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			<table class="form-table form-field-container">
60 60
 			
61 61
 				<!-- Default Value -->
62
-				<?php switch( $form_data_array['field_type'] ) { 
62
+				<?php switch( $form_data_array['field_type'] ) {
63 63
 						
64 64
 						default:
65 65
 						case 'radio':
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 									</label>
72 72
 								</td>
73 73
 								<td>
74
-									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
74
+									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
75 75
 											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
76 76
 									?>
77 77
 										<input type="radio" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 									</label>
96 96
 								</td>
97 97
 								<td>
98
-									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
98
+									<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
99 99
 											$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
100 100
 									?>
101 101
 										<input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 								</td>
121 121
 								<td>
122 122
 									<select type="default" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice]">
123
-										<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { 
123
+										<?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
124 124
 												$pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
125 125
 										?>
126 126
 											<option value="<?php echo $i; ?>" <?php selected( $pre_selected , $i ); ?>><?php echo $interest_group['name']; ?></option>
Please login to merge, or discard this patch.