rate = get_post_meta($obj->id,'popular_hide', true) == 1 ? 0 : get_post_meta($obj->id,'popular_ratio', true); return $obj;}, $posts); $rates = array(); foreach ($ratios as $item){ $rate = 100 * $item->rate/array_sum(array_map(function($obj){return $obj->rate;}, $ratios)); if($rate > 0 && count($rates <= 10)){ $rates[$item->id] = $rate; } } $count = (int)get_option('popularnode_list_count'); $count = $count+1; update_option('popularnode_list_count', $count); ?>