Title: Transfer Addon Error Message Not Returning
Last modified: April 28, 2023

---

# Transfer Addon Error Message Not Returning

 *  Resolved [8bit7](https://wordpress.org/support/users/8bit7/)
 * (@8bit7)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/)
 * The error message for the transfer addon isn’t displaying on the page properly.
   Instead it’s just echoing right after the body tag. This is really bad for my
   site and I’ve been trying to move it and even tried making a custom plugin to
   do so, but I’ve discovered it’s simply being echoed in /wp-content/plugins/mycred/
   addons/transfer/includes/mycred-transfer-object.php instead of returned.
 * I can comment out the echo, but then obviously there is no error being shown 
   even though there should be (the test user has no points, so he gets the error-
   minimum “You do not have enough points to make a transfer.” error.)
 * How do you suggest I fix this? I would be fine showing the message after the 
   page header, but it sure would be great to show it where the shortcode is being
   used on the page instead.
 * screenshot: [https://i.imgur.com/OacmuZi.jpg](https://i.imgur.com/OacmuZi.jpg)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [8bit7](https://wordpress.org/support/users/8bit7/)
 * (@8bit7)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/#post-16694255)
 * To clarify the issue is in /wp-content/plugins/mycred/addons/transfer/includes/
   mycred-transfer-object.php on line 1358. changing it to return $content and not
   echo $content fixes the problem. 
   1. is this good to do and 2. How can I change
   this without modifying the core mycred files?
 *     ```wp-block-code
       	/**
       		 * Get Error Message
       		 * @since 1.8
       		 * @version 1.0
       		 */
       		public function get_error_message( $return = false ) {
   
       			$content = '';
       			if ( ! empty( $this->errors ) ) {
       				foreach ( $this->errors as $error_code => $message ) {
   
       					$content = '<div class="alert alert-warning error-' . $error_code . '"><p>' . $message . '</p></div>';
   
       				}
       			}
   
       			$content = apply_filters( 'mycred_transfer_form_errors', $content, $this );
   
       			if ( $return )
       				return $content;
   
       			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
       			return $content; // MY EDIT -#- WAS ECHO, NOW IS RETURN. 
   
       		}
       ```
   
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/#post-16703851)
 * Hello [@8bit7](https://wordpress.org/support/users/8bit7/) ,
 * Thanks for contacting us.
 * Hope you are doing well, Instead of making changes in the content/plugins/mycred/
   addons/transfer/includes/mycred-transfer-object.php file, We recommend you to
   make changes in content/plugins/mycred/addons/transfer/includes/mycred-transfer-
   shortcodes file on line number 74.
 * Modify the code as follows:
 *     ```wp-block-code
       $output = do_shortcode( $transfer->get_error_message(true) );
       ```
   
 * It is the proper fix for the issue. This change will also be included in our 
   upcoming release myCred 2.5.1
 * Let me know if you have any question.
 * Thanks & Regards,
 * WP Experts Support Team
 *  Thread Starter [8bit7](https://wordpress.org/support/users/8bit7/)
 * (@8bit7)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/#post-16708152)
 * Awesome. Glad to hear it’s being fixed 🙂 
   I did as you said and can confirm 
   it is still working perfectly. Thanks so much!
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/#post-16709463)
 * Thanks for the update. We are glad your issue is fixed.
 * Let me know if you have any question. We will help you out.
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Transfer Addon Error Message Not Returning’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

## Tags

 * [addon](https://wordpress.org/support/topic-tag/addon/)

 * 4 replies
 * 2 participants
 * Last reply from: [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/transfer-addon-error-message-not-returning/#post-16709463)
 * Status: resolved