JosephGabito / subway-2.0

Subway is a plugin for WordPress that allows you to hide the content of your website to non-logged in visitors and only displays them to logged in users.
http://dunhakdis.com
2 stars 1 forks source link

bugfix, fixes #54 #55

Closed rasmuserik closed 5 years ago

rasmuserik commented 5 years ago

When you

unset( $public_posts[ array_search( $post_id, $public_posts ) ] );

and $post_id is not in $public_posts, it will remove the first element in the list, - which means that when changing a private post, that was not public, it will remove another public post from the list of public posts.

This bugfix makes sure that $post_id is in the list of public posts, before trying to remove it, thus fixing #54

Please include this in a release soon :)