@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -7,12 +7,12 @@ |
||
7 | 7 | <div class="wrap"> |
8 | 8 | |
9 | 9 | <!-- Freddie Logo --> |
10 | - <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
10 | + <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
11 | 11 | |
12 | - <h1>YIKES Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
12 | + <h1>YIKES Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
13 | 13 | |
14 | 14 | <!-- Addons Page Description --> |
15 | - <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find a list of add-ons available for YIKES Easy Forms for MailChimp. Each add-on extends the base functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
15 | + <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find a list of add-ons available for YIKES Easy Forms for MailChimp. Each add-on extends the base functionality of the free plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
16 | 16 | |
17 | 17 | <!-- Add-On Container --> |
18 | 18 | <section id="add-ons"> |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | <div class="addon-footer-wrap give-clearfix"> |
34 | 34 | <a href="<?php echo esc_attr( $permalink ); ?>" title="<?php echo esc_attr( $add_on_title ); ?>" class="button-secondary" target="_blank"> |
35 | - <?php esc_attr_e( 'View Add-on' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
35 | + <?php esc_attr_e( 'View Add-on', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
36 | 36 | <span class="dashicons dashicons-external"></span></a> |
37 | 37 | </div> |
38 | 38 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | printf( '<h2>' . esc_attr__( 'Popular Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ) . '</h2>' ); |
31 | 31 | printf( '<ol>' ); |
32 | 32 | foreach ( $knowledge_base_links as $kb_link ) { |
33 | - echo wp_kses_post( '<li><a href="' . esc_url( $kb_link['href'] ) . '" title="' . esc_attr( $kb_link['title'] ) . '" target="_blank">' . esc_attr( $kb_link['title'] ) . '</a></li>' ); |
|
33 | + echo wp_kses_post( '<li><a href="' . esc_url( $kb_link[ 'href' ] ) . '" title="' . esc_attr( $kb_link[ 'title' ] ) . '" target="_blank">' . esc_attr( $kb_link[ 'title' ] ) . '</a></li>' ); |
|
34 | 34 | } |
35 | 35 | printf( '</ol>' ); |
36 | 36 | } |
@@ -12,42 +12,42 @@ discard block |
||
12 | 12 | array( |
13 | 13 | 'form' => '', // pass in a form, which will retreive the associated list ID -- takes precendence |
14 | 14 | 'list' => '', // pass in a specific list ID |
15 | - ), $attributes , 'yikes-mailchimp-subscriber-count' ) |
|
15 | + ), $attributes, 'yikes-mailchimp-subscriber-count' ) |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | /* If the user hasn't authenticated yet - bail */ |
19 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) { |
|
20 | - if( WP_DEBUG ) { |
|
19 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) { |
|
20 | + if ( WP_DEBUG ) { |
|
21 | 21 | return '<strong>' . __( "You don't appear to be connected to MailChimp.", "yikes-inc-easy-mailchimp-extender" ) . '</strong>'; |
22 | 22 | } |
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
26 | - $form = ( ! empty( $attributes['form'] ) ) ? str_replace( '"', '', $attributes['form'] ) : false; // replace the sanitize quotes to perform a proper query |
|
27 | - $list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false; |
|
26 | + $form = ( ! empty( $attributes[ 'form' ] ) ) ? str_replace( '"', '', $attributes[ 'form' ] ) : false; // replace the sanitize quotes to perform a proper query |
|
27 | + $list_id = ( ! empty( $attributes[ 'list' ] ) ) ? $attributes[ 'list' ] : false; |
|
28 | 28 | |
29 | 29 | /* If no list ID was passed into the shortcode - bail */ |
30 | - if( ! $list_id && ! $form) { |
|
31 | - if( WP_DEBUG ) { |
|
30 | + if ( ! $list_id && ! $form ) { |
|
31 | + if ( WP_DEBUG ) { |
|
32 | 32 | return '<strong>' . __( 'You forgot to include the list or form ID.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; |
33 | 33 | } |
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | 37 | /* if a form ID and a list ID were passed in, use the form ID */ |
38 | - if( ( $form ) || ( $form && $list_id ) ) { |
|
38 | + if ( ( $form ) || ( $form && $list_id ) ) { |
|
39 | 39 | global $wpdb; |
40 | 40 | // return it as an array, so we can work with it to build our form below |
41 | 41 | $form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form . '', ARRAY_A ); |
42 | 42 | // confirm we have some results, or return an error |
43 | - if( ! $form_results ) { |
|
44 | - if( WP_DEBUG ) { |
|
45 | - return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form." , 'yikes-inc-easy-mailchimp-extender' ); |
|
43 | + if ( ! $form_results ) { |
|
44 | + if ( WP_DEBUG ) { |
|
45 | + return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form.", 'yikes-inc-easy-mailchimp-extender' ); |
|
46 | 46 | } |
47 | 47 | return; |
48 | 48 | } |
49 | - $form_data = $form_results[0]; |
|
50 | - $list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
49 | + $form_data = $form_results[ 0 ]; |
|
50 | + $list_id = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // object buffer |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // get the api key |
60 | 60 | $api_key = yikes_get_mc_api_key(); |
61 | 61 | $dash_position = strpos( $api_key, '-' ); |
62 | - if( $dash_position !== false ) { |
|
62 | + if ( $dash_position !== false ) { |
|
63 | 63 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
64 | 64 | } |
65 | 65 | |
@@ -76,23 +76,23 @@ discard block |
||
76 | 76 | ) ); |
77 | 77 | |
78 | 78 | $subscriber_count_response = json_decode( wp_remote_retrieve_body( $subscriber_count_response ), true ); |
79 | - if( isset( $subscriber_count_response['error'] ) ) { |
|
80 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
79 | + if ( isset( $subscriber_count_response[ 'error' ] ) ) { |
|
80 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
81 | 81 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
82 | 82 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
83 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscriber_count_response['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "yikes-mailchimp-subscriber-count.php" ); |
|
83 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscriber_count_response[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "yikes-mailchimp-subscriber-count.php" ); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | // if more than one list is returned, something went wrong - bail |
87 | - if( $subscriber_count_response['total'] != 1 ) { |
|
88 | - if( WP_DEBUG ) { |
|
87 | + if ( $subscriber_count_response[ 'total' ] != 1 ) { |
|
88 | + if ( WP_DEBUG ) { |
|
89 | 89 | return '<strong>' . sprintf( __( "It looks like this list wasn't found. Double check the list with with ID '%s' exists.", "yikes-inc-easy-mailchimp-extender" ), $list_id ) . '</strong>'; |
90 | 90 | } |
91 | 91 | return; |
92 | 92 | } |
93 | 93 | |
94 | 94 | /* type cast the returned value as an integer */ |
95 | - echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $subscriber_count_response['data'][0]['stats']['member_count'] ); |
|
95 | + echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $subscriber_count_response[ 'data' ][ 0 ][ 'stats' ][ 'member_count' ] ); |
|
96 | 96 | |
97 | 97 | } catch ( Exception $error ) { |
98 | 98 | echo $error->getMessage(); |
@@ -10,35 +10,35 @@ discard block |
||
10 | 10 | */ |
11 | 11 | $api_key = yikes_get_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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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> |