[Plugin: WP-PostViews] Notice error when debug is turned on
-
I am getting the following notice error when I have debug turned on:
Notice: Undefined index: postviews_id in /wordpress/wp-content/plugins/wp-postviews/wp-postviews.php on line 646
Line 646 is currently set as:
$post_id = intval($_GET['postviews_id']);
To remove the notice error, it just needs to be changed to:
$post_id = isset($_GET['postviews_id']) ? intval($_GET['postviews_id']) : 0;
Found another one:
Notice: Undefined index: views in /wordpress/wp-content/plugins/wp-postviews/wp-postviews.php on line 67
Line 67:
$post_views = intval($post_views['views'][0]);
Should be:
$post_views = isset($post_views['views'][0]) ? intval($post_views['views'][0]) : 0;
Hope that helps!
- The topic ‘[Plugin: WP-PostViews] Notice error when debug is turned on’ is closed to new replies.