PHP 7.2 compat
-
Hi.
error logs are full of this:PHP message: PHP Warning: A non-numeric value encountered in /wp-content/plugins/vkontakte-api/includes/comments.php on line 989 PHP message: PHP Warning: A non-numeric value encountered in /wp-content/plugins/vkontakte-api/includes/comments.php on line 1120
get_postmeta() can return empty string or false in case there is no meta field,
it needs to be checkedsomething like this will suffice:
<------>public function add_tabs_button_wp() { <------><------>global $post; <------><------>$vkapi_comm = get_post_meta( $post->ID, 'vkapi_comm', true ); <------><------>$fbapi_comm = get_post_meta( $post->ID, 'fbapi_comm', true ); <------><------>if ($fbapi_comm != '' && $fbapi_comm != false) $fappi = (int)($fbapi_comm); <------><------>if ($vkapi_comm != '' && $vkapi_comm != false) $vappi = (int)($vkapi_comm); <------><------>$comm_wp = get_comments_number() - $vappi - $fappi; <------><------>$text = __( 'Site', 'vkapi' ); <------><------>echo "<div> <------><------><------> <button style='white-space:nowrap' <------><------><------> class='submit' <------><------><------> onclick='showWP()'> <------><------><------> {$text} ({$comm_wp}) <------><------><------> </button> <------><------><------></div>"; <------>}
likewise for public function do_non_empty()
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘PHP 7.2 compat’ is closed to new replies.