Title: Logout Shortcode creates Notice: Undefined variable: ReturnString
Last modified: August 22, 2016

---

# Logout Shortcode creates Notice: Undefined variable: ReturnString

 *  [tannermccoleman](https://wordpress.org/support/users/tannermccoleman/)
 * (@tannermccoleman)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/logout-button-creates-notice-undefined-variable-returnstring/)
 * > Notice: Undefined variable: ReturnString in /wp-content/plugins/front-end-only-
   > users/Shortcodes/Insert_Logout.php on line 22
 * Can be solved by adding $ReturnString = “”; anytime before line 22
 * [https://wordpress.org/plugins/front-end-only-users/](https://wordpress.org/plugins/front-end-only-users/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [tannermccoleman](https://wordpress.org/support/users/tannermccoleman/)
 * (@tannermccoleman)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/logout-button-creates-notice-undefined-variable-returnstring/#post-5514550)
 * Full Solution:
 *     ```
       /* The function that creates the HTML on the front-end, based on the parameters
       * supplied in the product-catalog shortcode */
       function Insert_Logout($atts) {
       		// Include the required global variables, and create a few new ones
       		$Salt = get_option("EWD_FEUP_Hash_Salt");
       		$Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
       		$CookieName = urlencode("EWD_FEUP_Login" . "%" . sha1(md5(get_site_url().$Salt)));
       		$ReturnString = "";
   
       		// Get the attributes passed by the shortcode, and store them in new variables for processing
       		extract( shortcode_atts( array(
       						 								 		'no_message' => '',
       																'redirect_page' => '#',
       																'submit_text' => 'Logout'),
       																$atts
       														)
       												);
   
       		setcookie($CookieName, "", time()-3600, "/");
       		if ($redirect_page != "#") {FEUPRedirect($redirect_page);}
   
       		$ReturnString .= "<style type='text/css'>";
       		$ReturnString .= $Custom_CSS;
       		$ReturnString .= "</style>";
   
       		$ReturnString .= "<div class='feup-information-div'>";
       		$ReturnString .= __("You have been successfully logged out." , "EWD_FEUP");
       		$ReturnString .= "</div>";
   
       		if ($no_message != "Yes") {return $ReturnString;}
       }
       add_shortcode("logout", "Insert_Logout");
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Logout Shortcode creates Notice: Undefined variable: ReturnString’ is
closed to new replies.

 * ![](https://ps.w.org/front-end-only-users/assets/icon-128x128.png?rev=1805921)
 * [Front End Users](https://wordpress.org/plugins/front-end-only-users/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/front-end-only-users/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/front-end-only-users/)
 * [Active Topics](https://wordpress.org/support/plugin/front-end-only-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/front-end-only-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/front-end-only-users/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [tannermccoleman](https://wordpress.org/support/users/tannermccoleman/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/logout-button-creates-notice-undefined-variable-returnstring/#post-5514550)
 * Status: not a support question