function vortex_system_columns_value($column, $post_id) { global $post; switch ($column) { case 'likes': $likes = vortex_get_meta($post_id, 'vortex_system_likes', true); if (empty($likes)) { echo '0'; } else { echo $likes; } break; case 'dislikes': $dislikes = vortex_get_meta($post_id, 'vortex_system_dislikes', true); if (empty($dislikes)) { echo '0'; } else { echo $dislikes; } break; /* Just break out of the switch statement for everything else. */ /* Just break out of the switch statement for everything else. */ default: break; } }
function vortex_system_get_total_likes_buddypress($id) { $likes = vortex_get_meta($id, 'vortex_system_likes', true); if (empty($likes)) { return 0; } elseif (!$likes == '') { return $dislikes = vortex_get_meta($id, 'vortex_system_likes', true); } }