@@ -5,25 +5,25 @@ |
||
| 5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 6 | 6 | * @since 6.0 |
| 7 | 7 | */ |
| 8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 11 | - $field_data = $form_data['custom_fields']; |
|
| 8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | <div class="custom-field-section"> |
| 15 | 15 | <!-- title --> |
| 16 | - <strong><?php echo $field['label']; ?></strong> |
|
| 16 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
| 17 | 17 | |
| 18 | 18 | <!-- Dropdown --> |
| 19 | - <select class="custom-select-field" name="custom-field[<?php echo $field['id']; ?>]"> |
|
| 20 | - <?php foreach( $field['options'] as $value => $label ) { ?> |
|
| 21 | - <option value="<?php echo $value; ?>" <?php if( isset( $field_data[$field['id']] ) ) { selected( $field_data[$field['id']] , $value ); } ?>><?php echo $label; ?></option> |
|
| 19 | + <select class="custom-select-field" name="custom-field[<?php echo $field[ 'id' ]; ?>]"> |
|
| 20 | + <?php foreach ( $field[ 'options' ] as $value => $label ) { ?> |
|
| 21 | + <option value="<?php echo $value; ?>" <?php if ( isset( $field_data[ $field[ 'id' ] ] ) ) { selected( $field_data[ $field[ 'id' ] ], $value ); } ?>><?php echo $label; ?></option> |
|
| 22 | 22 | <?php } ?> |
| 23 | 23 | </select> |
| 24 | 24 | |
| 25 | 25 | <!-- description --> |
| 26 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
| 27 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 26 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
| 27 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 28 | 28 | <?php } ?> |
| 29 | 29 | </div> |
| 30 | 30 | \ No newline at end of file |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 6 | 6 | * @since 6.0 |
| 7 | 7 | */ |
| 8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 11 | - $field_data = $form_data['custom_fields']; |
|
| 8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | <label class="custom-field-section"> |
| 15 | - <strong><?php echo $field['label']; ?></strong> |
|
| 16 | - <input type="text" class="widefat" name="custom-field[<?php echo $field['id']; ?>]" id="custom-field" value="<?php echo isset( $field_data[$field['id']] ) ? $field_data[$field['id']] : ''; ?>" placeholder="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : ''; ?>"> |
|
| 17 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
| 18 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 15 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
| 16 | + <input type="text" class="widefat" name="custom-field[<?php echo $field[ 'id' ]; ?>]" id="custom-field" value="<?php echo isset( $field_data[ $field[ 'id' ] ] ) ? $field_data[ $field[ 'id' ] ] : ''; ?>" placeholder="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>"> |
|
| 17 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
| 18 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 19 | 19 | <?php } ?> |
| 20 | 20 | </label> |
| 21 | 21 | \ No newline at end of file |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 6 | 6 | * @since 6.0 |
| 7 | 7 | */ |
| 8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 11 | - $field_data = $form_data['custom_fields']; |
|
| 8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | <label class="custom-field-section"> |
| 15 | - <strong><?php echo $field['label']; ?></strong> |
|
| 16 | - <input type="checkbox" class="widefat" name="custom-field[<?php echo $field['id']; ?>]" id="custom-field" value="1" <?php checked( isset( $field_data[$field['id']] ) ? $field_data[$field['id']] : 0, 1, true ); ?>> |
|
| 17 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
| 18 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 15 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
| 16 | + <input type="checkbox" class="widefat" name="custom-field[<?php echo $field[ 'id' ]; ?>]" id="custom-field" value="1" <?php checked( isset( $field_data[ $field[ 'id' ] ] ) ? $field_data[ $field[ 'id' ] ] : 0, 1, true ); ?>> |
|
| 17 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
| 18 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 19 | 19 | <?php } ?> |
| 20 | 20 | </label> |
@@ -5,10 +5,10 @@ discard block |
||
| 5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 6 | 6 | * @since 6.0 |
| 7 | 7 | */ |
| 8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 11 | - $field_data = $form_data['custom_fields']; |
|
| 8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // This will enqueue the Media Uploader script |
@@ -16,27 +16,27 @@ discard block |
||
| 16 | 16 | // And let's not forget the script we wrote earlier |
| 17 | 17 | wp_enqueue_script( 'yikes-mailchimp-file-field-script', plugin_dir_url( __FILE__ ) . 'js/yikes-mc-file-upload.js', array( 'jquery' ), '1.0', false ); |
| 18 | 18 | // print_r( $field_data ); |
| 19 | - wp_localize_script( 'yikes-mailchimp-file-field-script' , 'additional_data' , array( |
|
| 19 | + wp_localize_script( 'yikes-mailchimp-file-field-script', 'additional_data', array( |
|
| 20 | 20 | 'wp_includes_image_url' => includes_url() . 'images/media/' |
| 21 | 21 | ) ); |
| 22 | 22 | $i = 1; |
| 23 | 23 | // create an single item array when nothing is stored yet, loop for one field |
| 24 | - $field_data['incentive-attachment'] = ( isset( $field_data['incentive-attachment'] ) && !empty( $field_data['incentive-attachment'] ) ) ? $field_data['incentive-attachment'] : array( '' ); |
|
| 24 | + $field_data[ 'incentive-attachment' ] = ( isset( $field_data[ 'incentive-attachment' ] ) && ! empty( $field_data[ 'incentive-attachment' ] ) ) ? $field_data[ 'incentive-attachment' ] : array( '' ); |
|
| 25 | 25 | ?> |
| 26 | 26 | |
| 27 | 27 | <div class="yikes-mailchimp-file-field"> |
| 28 | - <label for="image_url" class="widefat"><strong><?php echo $field['label']; ?></strong></label> |
|
| 29 | - <?php foreach( $field_data['incentive-attachment'] as $attachment ) { ?> |
|
| 30 | - <input type="text" name="custom-field[<?php echo $field['id']; ?>][<?php echo $i; ?>]" id="custom-field[<?php echo $field['id']; ?>][<?php echo $i; ?>]" class="file-attachment" value="<?php echo isset( $field_data[$field['id']][$i] ) ? $field_data[$field['id']][$i] : ''; ?>"> |
|
| 31 | - <input type="button" name="upload-btn" id="upload-btn" class="button-secondary" data-attr-position="<?php echo $i; ?>" value="<?php _e( 'Upload File' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
| 28 | + <label for="image_url" class="widefat"><strong><?php echo $field[ 'label' ]; ?></strong></label> |
|
| 29 | + <?php foreach ( $field_data[ 'incentive-attachment' ] as $attachment ) { ?> |
|
| 30 | + <input type="text" name="custom-field[<?php echo $field[ 'id' ]; ?>][<?php echo $i; ?>]" id="custom-field[<?php echo $field[ 'id' ]; ?>][<?php echo $i; ?>]" class="file-attachment" value="<?php echo isset( $field_data[ $field[ 'id' ] ][ $i ] ) ? $field_data[ $field[ 'id' ] ][ $i ] : ''; ?>"> |
|
| 31 | + <input type="button" name="upload-btn" id="upload-btn" class="button-secondary" data-attr-position="<?php echo $i; ?>" value="<?php _e( 'Upload File', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
| 32 | 32 | <div class="file-container"> |
| 33 | 33 | <p class="file-remove-wrapper"> |
| 34 | - <a href="#" class="remove-file-button" data-attr-position="<?php echo $i; ?>"><?php _e( 'Remove File' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
| 34 | + <a href="#" class="remove-file-button" data-attr-position="<?php echo $i; ?>"><?php _e( 'Remove File', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
| 35 | 35 | </p> |
| 36 | 36 | </div> |
| 37 | 37 | <?php $i++; } ?> |
| 38 | - <?php if( isset( $field['repeat'] ) ) { ?> |
|
| 38 | + <?php if ( isset( $field[ 'repeat' ] ) ) { ?> |
|
| 39 | 39 | <a href="#" class="button-secondary add-new-incentive-attachment" data-attr-position="<?php echo $i; ?>"><span class="dashicons dashicons-plus"></span></a> |
| 40 | 40 | <?php } ?> |
| 41 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 41 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 42 | 42 | </div> |
| 43 | 43 | \ No newline at end of file |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 7 | 7 | * @since 6.0 |
| 8 | 8 | */ |
| 9 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 10 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 11 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 12 | - $field_data = $form_data['custom_fields']; |
|
| 9 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 10 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 11 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 12 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - $content = ( isset( $field_data[$field['id']] ) ) ? $field_data[$field['id']] : ( isset( $field['default'] ) ? $field['default'] : '' ); |
|
| 16 | - $wysiwyg_id = 'custom-field['.$field['id'].']'; |
|
| 15 | + $content = ( isset( $field_data[ $field[ 'id' ] ] ) ) ? $field_data[ $field[ 'id' ] ] : ( isset( $field[ 'default' ] ) ? $field[ 'default' ] : '' ); |
|
| 16 | + $wysiwyg_id = 'custom-field[' . $field[ 'id' ] . ']'; |
|
| 17 | 17 | ?> |
| 18 | 18 | |
| 19 | 19 | <div class="yikes-mailchimp-wysiwyg-field"> |
| 20 | - <label for="image_url" class="widefat"><strong><?php echo $field['label']; ?></strong></label> |
|
| 21 | - <?php wp_editor( $content, $field['id'], array( 'textarea_name' => $wysiwyg_id ) ); ?> |
|
| 22 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 20 | + <label for="image_url" class="widefat"><strong><?php echo $field[ 'label' ]; ?></strong></label> |
|
| 21 | + <?php wp_editor( $content, $field[ 'id' ], array( 'textarea_name' => $wysiwyg_id ) ); ?> |
|
| 22 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 23 | 23 | </div> |
@@ -5,26 +5,26 @@ |
||
| 5 | 5 | * For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/] |
| 6 | 6 | * @since 6.0 |
| 7 | 7 | */ |
| 8 | - if ( is_string( $form_data['custom_fields'] ) ) { |
|
| 9 | - $field_data = json_decode( $form_data['custom_fields'] , true ); |
|
| 10 | - } elseif ( is_array( $form_data['custom_fields'] ) ) { |
|
| 11 | - $field_data = $form_data['custom_fields']; |
|
| 8 | + if ( is_string( $form_data[ 'custom_fields' ] ) ) { |
|
| 9 | + $field_data = json_decode( $form_data[ 'custom_fields' ], true ); |
|
| 10 | + } elseif ( is_array( $form_data[ 'custom_fields' ] ) ) { |
|
| 11 | + $field_data = $form_data[ 'custom_fields' ]; |
|
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | <div class="custom-field-section"> |
| 15 | 15 | <!-- title --> |
| 16 | - <strong><?php echo $field['label']; ?></strong> |
|
| 16 | + <strong><?php echo $field[ 'label' ]; ?></strong> |
|
| 17 | 17 | <!-- radio buttons --> |
| 18 | 18 | <section class="custom-radio-holder"> |
| 19 | - <?php foreach( $field['options'] as $value => $label ) { ?> |
|
| 19 | + <?php foreach ( $field[ 'options' ] as $value => $label ) { ?> |
|
| 20 | 20 | <label class="custom-radio-label"> |
| 21 | - <input type="radio" name="custom-field[<?php echo $field['id']; ?>][]" id="custom-field" value="<?php echo $value; ?>" <?php if( isset( $field_data[$field['id']] ) ) { checked( $field_data[$field['id']] , $value ); } ?>> |
|
| 21 | + <input type="radio" name="custom-field[<?php echo $field[ 'id' ]; ?>][]" id="custom-field" value="<?php echo $value; ?>" <?php if ( isset( $field_data[ $field[ 'id' ] ] ) ) { checked( $field_data[ $field[ 'id' ] ], $value ); } ?>> |
|
| 22 | 22 | <?php echo $label; ?> |
| 23 | 23 | </label> |
| 24 | 24 | <?php } ?> |
| 25 | 25 | </section> |
| 26 | 26 | <!-- description --> |
| 27 | - <?php if( isset( $field['description'] ) && $field['description'] != '' ) { ?> |
|
| 28 | - <p class="description"><?php echo $field['description']; ?></p> |
|
| 27 | + <?php if ( isset( $field[ 'description' ] ) && $field[ 'description' ] != '' ) { ?> |
|
| 28 | + <p class="description"><?php echo $field[ 'description' ]; ?></p> |
|
| 29 | 29 | <?php } ?> |
| 30 | 30 | </div> |
| 31 | 31 | \ No newline at end of file |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | * Get and store our variables |
| 4 | 4 | * @since 6.0 |
| 5 | 5 | */ |
| 6 | -$list_id = $_GET['mailchimp-list']; |
|
| 7 | -$email_id = esc_attr( $_GET['email-id'] ); |
|
| 6 | +$list_id = $_GET[ 'mailchimp-list' ]; |
|
| 7 | +$email_id = esc_attr( $_GET[ 'email-id' ] ); |
|
| 8 | 8 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
| 9 | 9 | |
| 10 | 10 | /* |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $other_lists = $list_helper->get_members_lists( $email_id ); |
| 39 | -$merge_data_array = $user_data['merge_fields']; |
|
| 39 | +$merge_data_array = $user_data[ 'merge_fields' ]; |
|
| 40 | 40 | |
| 41 | 41 | $additional_lists = array(); |
| 42 | 42 | $merge_variable_fields = array(); |
| 43 | 43 | |
| 44 | 44 | /* Build the array of mailing lists the user is subscribed to */ |
| 45 | 45 | foreach ( $other_lists as $id => $value ) { |
| 46 | - if ( 'subscribed' !== $value['status'] ) { |
|
| 46 | + if ( 'subscribed' !== $value[ 'status' ] ) { |
|
| 47 | 47 | continue; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | continue; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $additional_lists[ $list_data['id'] ] = $list_data['name']; |
|
| 61 | + $additional_lists[ $list_data[ 'id' ] ] = $list_data[ 'name' ]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /* Build the array of merge variables => value */ |
@@ -74,21 +74,21 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | // loop and display |
| 76 | 76 | if ( $merge_variables ) { |
| 77 | - foreach ( $merge_variables['merge_fields'] as $merge_variable ) { |
|
| 78 | - if ( $merge_variable['tag'] != 'EMAIL' ) { |
|
| 79 | - $merge_variable_fields[ $merge_variable['name'] ] = ( isset( $merge_data_array[ $merge_variable['tag'] ] ) ) ? $merge_data_array[ $merge_variable['tag'] ] : ''; |
|
| 77 | + foreach ( $merge_variables[ 'merge_fields' ] as $merge_variable ) { |
|
| 78 | + if ( $merge_variable[ 'tag' ] != 'EMAIL' ) { |
|
| 79 | + $merge_variable_fields[ $merge_variable[ 'name' ] ] = ( isset( $merge_data_array[ $merge_variable[ 'tag' ] ] ) ) ? $merge_data_array[ $merge_variable[ 'tag' ] ] : ''; |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | // store usable data |
| 86 | -$user_email = sanitize_email( $user_data['email_address'] ); |
|
| 86 | +$user_email = sanitize_email( $user_data[ 'email_address' ] ); |
|
| 87 | 87 | // prepend our email address to the beginning |
| 88 | 88 | $merge_variable_fields = array( 'Email Address' => $user_email ) + $merge_variable_fields; |
| 89 | 89 | $gravatar_image = get_avatar( $user_email, 120 ); |
| 90 | -$email_type = $user_data['email_type']; |
|
| 91 | -$member_rating = ( ! empty( $user_data['member_rating'] ) ) ? (int) $user_data['member_rating'] : 0; |
|
| 90 | +$email_type = $user_data[ 'email_type' ]; |
|
| 91 | +$member_rating = ( ! empty( $user_data[ 'member_rating' ] ) ) ? (int) $user_data[ 'member_rating' ] : 0; |
|
| 92 | 92 | $member_rating_stars = ''; |
| 93 | 93 | |
| 94 | 94 | // Create member rating stars |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | -$last_changed = strtotime( $user_data['last_changed'] ); |
|
| 104 | -$user_language = ( ! empty( $user_data['language'] ) ) ? $user_data['language'] : ''; |
|
| 103 | +$last_changed = strtotime( $user_data[ 'last_changed' ] ); |
|
| 104 | +$user_language = ( ! empty( $user_data[ 'language' ] ) ) ? $user_data[ 'language' ] : ''; |
|
| 105 | 105 | $list_name = $additional_lists[ $list_id ]; |
| 106 | 106 | |
| 107 | 107 | // Generate our display page |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | <span class="member-subscription-date"> |
| 139 | 139 | <?php echo __( 'Subscribed:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . gmdate( 'F jS, Y h:i a', $last_changed ); ?> |
| 140 | 140 | </span> |
| 141 | - <?php if ( isset( $user_data['location'] ) && ! empty( $user_data['location'] ) ) { ?> |
|
| 142 | - <?php if ( isset( $user_data['location']['latitude'] ) && isset( $user_data['location']['longitude'] ) ) { ?> |
|
| 141 | + <?php if ( isset( $user_data[ 'location' ] ) && ! empty( $user_data[ 'location' ] ) ) { ?> |
|
| 142 | + <?php if ( isset( $user_data[ 'location' ][ 'latitude' ] ) && isset( $user_data[ 'location' ][ 'longitude' ] ) ) { ?> |
|
| 143 | 143 | <span class="member-location-data"> |
| 144 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data['location']['latitude'], $user_data['location']['longitude'] ); ?> |
|
| 144 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data[ 'location' ][ 'latitude' ], $user_data[ 'location' ][ 'longitude' ] ); ?> |
|
| 145 | 145 | </span> |
| 146 | 146 | <?php } else { ?> |
| 147 | 147 | <span class="member-location-data"> |
| 148 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data['location']['timezone'] . ', ' . $user_data['location']['country_code']; ?> |
|
| 148 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data[ 'location' ][ 'timezone' ] . ', ' . $user_data[ 'location' ][ 'country_code' ]; ?> |
|
| 149 | 149 | </span> |
| 150 | 150 | <?php |
| 151 | 151 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | <hr class="yikes-mc-subscriber-hr" /> |
| 157 | 157 | |
| 158 | 158 | <?php |
| 159 | - if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { |
|
| 159 | + if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { |
|
| 160 | 160 | ?> |
| 161 | 161 | <section class="yikes-mc-card-body merge-variable-section"> |
| 162 | 162 | <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | <strong><?php _e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
| 177 | 177 | <?php |
| 178 | 178 | } |
| 179 | - if ( isset( $user_data['ip_signup'] ) && $user_data['ip_signup'] != '' ) { |
|
| 179 | + if ( isset( $user_data[ 'ip_signup' ] ) && $user_data[ 'ip_signup' ] != '' ) { |
|
| 180 | 180 | ?> |
| 181 | 181 | <li> |
| 182 | 182 | <label> |
| 183 | - <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data['ip_signup']; ?></strong></p> |
|
| 183 | + <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data[ 'ip_signup' ]; ?></strong></p> |
|
| 184 | 184 | </label> |
| 185 | 185 | </li> |
| 186 | 186 | <?php |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | <?php |
| 192 | 192 | |
| 193 | 193 | |
| 194 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
| 194 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { |
|
| 195 | 195 | ?> |
| 196 | 196 | <section class="yikes-mc-card-body"> |
| 197 | 197 | <?php |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | ?> |
| 221 | 221 | |
| 222 | 222 | <?php |
| 223 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
| 223 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { |
|
| 224 | 224 | $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( |
| 225 | 225 | 'action' => 'yikes-easy-mc-unsubscribe-user', |
| 226 | 226 | 'mailchimp-list' => $list_id, |
@@ -275,36 +275,36 @@ discard block |
||
| 275 | 275 | <div id="customer-tab-wrapper"> |
| 276 | 276 | <ul id="customer-tab-wrapper-list"> |
| 277 | 277 | |
| 278 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
| 278 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
| 279 | 279 | <a title="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $subscriber_details; ?>"> |
| 280 | 280 | <?php } ?> |
| 281 | 281 | |
| 282 | - <li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 282 | + <li <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 283 | 283 | <span class="dashicons dashicons-id"></span></li> |
| 284 | 284 | |
| 285 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
| 285 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
| 286 | 286 | </a> |
| 287 | 287 | <?php } ?> |
| 288 | 288 | |
| 289 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?> |
|
| 289 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'additional-subscriptions' ) ) { ?> |
|
| 290 | 290 | <a title="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $additional_subscription_url; ?>"> |
| 291 | 291 | <?php } ?> |
| 292 | 292 | |
| 293 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 293 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 294 | 294 | <span class="dashicons dashicons-portfolio"></span></li> |
| 295 | 295 | |
| 296 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?> |
|
| 296 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) ) { ?> |
|
| 297 | 297 | </a> |
| 298 | 298 | <?php } ?> |
| 299 | 299 | |
| 300 | - <?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?> |
|
| 300 | + <?php if ( ! isset( $_GET[ 'section' ] ) || isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'delete-subscriber' ) { ?> |
|
| 301 | 301 | <a title="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $delete_subscriber_url; ?>"> |
| 302 | 302 | <?php } ?> |
| 303 | 303 | |
| 304 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 304 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
| 305 | 305 | <span class="dashicons dashicons-trash"></span></li> |
| 306 | 306 | |
| 307 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?> |
|
| 307 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) ) { ?> |
|
| 308 | 308 | </a> |
| 309 | 309 | <?php } ?> |
| 310 | 310 | |
@@ -326,9 +326,9 @@ discard block |
||
| 326 | 326 | if ( is_wp_error( $geocode_response_body ) ) { |
| 327 | 327 | return; |
| 328 | 328 | } |
| 329 | - $city = $geocode_response_body['results'][0]['address_components'][2]['short_name']; |
|
| 330 | - $state = $geocode_response_body['results'][0]['address_components'][5]['short_name']; |
|
| 331 | - $country = $geocode_response_body['results'][0]['address_components'][6]['short_name']; |
|
| 329 | + $city = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 2 ][ 'short_name' ]; |
|
| 330 | + $state = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 5 ][ 'short_name' ]; |
|
| 331 | + $country = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 6 ][ 'short_name' ]; |
|
| 332 | 332 | |
| 333 | 333 | return $link = '<a href="http://maps.google.com/maps?q=' . $latitude . ',' . $longitude . '" target="_blank" title="' . __( 'View Google Map', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $city . ', ' . $state . ', ' . $country . '</a> <span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>'; |
| 334 | 334 | } |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $this->api_key = $api_key; |
| 98 | 98 | $parts = $this->get_api_key_parts(); |
| 99 | - $this->key = $parts['key']; |
|
| 100 | - $this->dc = $parts['dc']; |
|
| 99 | + $this->key = $parts[ 'key' ]; |
|
| 100 | + $this->dc = $parts[ 'dc' ]; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | $parts = explode( '-', $this->api_key ); |
| 123 | 123 | |
| 124 | 124 | return array( |
| 125 | - 'key' => $parts[0], |
|
| 126 | - 'dc' => isset( $parts[1] ) ? $parts[1] : '', |
|
| 125 | + 'key' => $parts[ 0 ], |
|
| 126 | + 'dc' => isset( $parts[ 1 ] ) ? $parts[ 1 ] : '', |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * @return Yikes_Inc_Easy_MailChimp_API |
| 168 | 168 | */ |
| 169 | 169 | public function get_api( $version = '' ) { |
| 170 | - $version = $version ?: $this->get_default_api_version(); |
|
| 170 | + $version = $version ? : $this->get_default_api_version(); |
|
| 171 | 171 | |
| 172 | 172 | if ( ! array_key_exists( $version, $this->api ) || null === $this->api[ $version ] ) { |
| 173 | 173 | $this->api[ $version ] = new Yikes_Inc_Easy_MailChimp_API( $this->get_datacenter(), $this->get_api_key(), $version ); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Prevent direct access to the file |
| 9 | - defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
| 9 | + defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
| 10 | 10 | |
| 11 | 11 | class Yikes_Easy_MC_BuddyPress_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class { |
| 12 | 12 | |