igorbenic / wp-sponsors

[WordPress plugin] WP-Sponsors gives your sponsors or partners a separate home where can add a link and a logo. This is the development version of the plugin, for the latest stable release, please check wordpress.org
https://wordpress.org/plugins/wp-sponsors/
GNU General Public License v2.0
6 stars 6 forks source link

PHP notice #15

Closed Spreeuw closed 6 years ago

Spreeuw commented 6 years ago

I got this after updating the plugin to 2.4.1: Notice: Undefined index: wp_sponsor_link_behaviour in /wp-content/plugins/wp-sponsors/includes/class-wp-sponsors.php on line 334 https://github.com/studioespresso/wp-sponsors/blob/master/includes/class-wp-sponsors.php#L334

There's a check for the other $_POST values but not wp_sponsor_link_behaviour

quick fix:

$link_behaviour = isset($_POST['wp_sponsor_link_behaviour']) ? '1' : '0';
janhenckens commented 6 years ago

Fixed in the today's update.