@@ -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 |
@@ -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 ); |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | return ''; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $form = ( ! empty( $attributes['form'] ) ) ? str_replace( '"', '', $attributes['form'] ) : false; |
|
| 30 | - $list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false; |
|
| 29 | + $form = ( ! empty( $attributes[ 'form' ] ) ) ? str_replace( '"', '', $attributes[ 'form' ] ) : false; |
|
| 30 | + $list_id = ( ! empty( $attributes[ 'list' ] ) ) ? $attributes[ 'list' ] : false; |
|
| 31 | 31 | |
| 32 | 32 | /* If no list ID was passed into the shortcode - bail */ |
| 33 | 33 | if ( ! $list_id && ! $form ) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | return ''; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 55 | + $list_id = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // object buffer |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* type cast the returned value as an integer */ |
| 74 | - echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data['stats']['member_count'] ); |
|
| 74 | + echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data[ 'stats' ][ 'member_count' ] ); |
|
| 75 | 75 | |
| 76 | 76 | return ob_get_clean(); |
| 77 | 77 | |
@@ -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>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>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 all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the 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 all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
| 16 | 16 | |
| 17 | 17 | <!-- Add-On Container --> |
| 18 | 18 | <section id="add-ons"> |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // If the API gave an error or there are no more lists, break. |
| 82 | - if ( isset( $response['error'] ) ) { |
|
| 83 | - return new WP_Error( $response['title'], $response['detail'] ); |
|
| 82 | + if ( isset( $response[ 'error' ] ) ) { |
|
| 83 | + return new WP_Error( $response[ 'title' ], $response[ 'detail' ] ); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ( empty( $response[ $item_key ] ) ) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Update the total number of items if it's still zero. |
| 91 | 91 | if ( 0 === $total ) { |
| 92 | - $total = intval( $response['total_items'] ); |
|
| 92 | + $total = intval( $response[ 'total_items' ] ); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Store each new list. |
@@ -196,16 +196,16 @@ discard block |
||
| 196 | 196 | return $response; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - if ( isset( $response['error'] ) ) { |
|
| 200 | - $title = isset( $response['title'] ) ? $response['title'] : $response['name']; |
|
| 201 | - $detail = isset( $response['detail'] ) ? $response['detail'] : $response['error']; |
|
| 202 | - $data = isset( $response['errors'] ) ? $response['errors'] : array(); |
|
| 199 | + if ( isset( $response[ 'error' ] ) ) { |
|
| 200 | + $title = isset( $response[ 'title' ] ) ? $response[ 'title' ] : $response[ 'name' ]; |
|
| 201 | + $detail = isset( $response[ 'detail' ] ) ? $response[ 'detail' ] : $response[ 'error' ]; |
|
| 202 | + $data = isset( $response[ 'errors' ] ) ? $response[ 'errors' ] : array(); |
|
| 203 | 203 | |
| 204 | 204 | return new WP_Error( |
| 205 | 205 | $title, |
| 206 | 206 | $detail, |
| 207 | 207 | array( |
| 208 | - 'status' => (int) $response['status'], |
|
| 208 | + 'status' => (int) $response[ 'status' ], |
|
| 209 | 209 | 'data' => $data, |
| 210 | 210 | ) |
| 211 | 211 | ); |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | // MailChimp uses the application/problem+json type for errors |
| 236 | 236 | $headers = wp_remote_retrieve_headers( $response ); |
| 237 | - if ( isset( $headers['content-type'] ) ) { |
|
| 238 | - if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) { |
|
| 239 | - $body['error'] = true; |
|
| 237 | + if ( isset( $headers[ 'content-type' ] ) ) { |
|
| 238 | + if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) { |
|
| 239 | + $body[ 'error' ] = true; |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |