$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:
https://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.
- The topic ‘$postto variable is undefined’ is closed to new replies.