Title: $postto variable is undefined
Last modified: August 21, 2016

---

# $postto variable is undefined

 *  [mebrand](https://wordpress.org/support/users/asfadel/)
 * (@asfadel)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/)
 * Can’t subscribe either unsubscribe with widget.
 * In debug mode after un/subscribing email in widget form we’ve received this escaped
   string in browser address bar looks like this:
 * [http://example.com/category/post-name/](http://example.com/category/post-name/)
   
   <b>Notice</b>: Undefined variable: postPermalink in <b>/home/user/example.com/
   public_html/wp-content/plugins/subscribe2-widget-pro/includes/templates/widget-
   output.php</b> on line <b>161</b>
 * The problem there’s no **$postPermalink** defined, because **$postto** either
   not equal ‘home’ or undefined.
 *     ```
       if ( ! empty( $postto ) && $postto !== 'home' ) {
       			$postPermalink = get_permalink( $postto ) ;
       		} elseif ( $postto == 'home' ) {
       			$postPermalink = get_bloginfo( 'wpurl' ) ;
       		}
       // MY OWN ADDITION FOR DEBUG
       		else {
       			$postPermalink = '$postto variable is null';
       		}
       ```
   
 * widget.php contains this condition
    `$postto = empty( $instance['postto'] ) ?'':
   $instance['postto'];`
 * i’ve tried to figured out where $instance defined and find nothing.
 * There is two function:
    `function widget( $args, $instance )` and `function form(
   $instance )`
 * I’ve not found where does this function uses and what kind of $instance variable
   function received. Have no idea why does $instance[‘postto’] contain nothing.
   I will be glad for any advice.
 * [https://wordpress.org/plugins/subscribe2-widget-pro/](https://wordpress.org/plugins/subscribe2-widget-pro/)

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

 *  Plugin Author [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4697974)
 * Interesting, I have not run into this before. I will investigate ASAP and post
   back any questions or resolutions. Please let me know if you find anything else
   out.
 *  Thread Starter [mebrand](https://wordpress.org/support/users/asfadel/)
 * (@asfadel)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4698128)
 * Hi, Devin. I’ve got some news!
 * The problem is occurred when opt-in form in Subscribe2 Widget Pro **Submission
   Options** parameter setted to **Use Subscribe2 default** (by default and for 
   the first time) and if you’ve not setted Subscribe2 plugin **default Subscribe2
   page** parameter at `/wp-admin/admin.php?page=s2_settings&tab=appearance` before
   and setted it after Subscribe2 Widget Pro configuration or/and if you’ve changed**
   default Subscribe2 page** widget keeps empty data for slected **Submission Options**-
   > **Post form content to page** option:
    `<option value="">Use Subscribe2 default
   </option>`
 * Here it is. I hope it will be helpful to investigate. Great widget, by the way.
 * One more thing: I’ve no idea why does widget do not load selected styles and 
   why widget-output.php can not receive `$options = get_option( 's2w_widget_settings');`
   
   and why does var_dump( $options) returning this: `string(0) ""`
 * Should I try to remove and install the widget again?
 *  Thread Starter [mebrand](https://wordpress.org/support/users/asfadel/)
 * (@asfadel)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4698131)
 *     ```
       SELECT *
       FROM "wp_options"
       WHERE "option_name"
       REGEXP "s2w"
       LIMIT 0 , 30
       ```
   
 * returns an empty option_value field
 *     ```
       option_id -- 5623
       option_name -- s2w_widget_settings
       option_value --
       autoload -- yes
       ```
   
 *  Plugin Author [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4698184)
 * Thanks for the great research. I’m going to look into your findings and see if
   I can patch this bug.
 *  Plugin Author [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4698311)
 * I was able to reproduce the postPermalink undefined issue and am working to release
   a fix for that bug. Most people have the Subscribe2 plugin setup so that’s why
   I’m thinking it hasn’t been noticed until now.

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

The topic ‘$postto variable is undefined’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/subscribe2-widget-pro_e8f0f9.svg)
 * [Subscribe2 Widget Pro](https://wordpress.org/plugins/subscribe2-widget-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe2-widget-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe2-widget-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe2-widget-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe2-widget-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe2-widget-pro/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/postto-variable-is-undefined/#post-4698311)
 * Status: not resolved