{@ $total_count = 0; $where_list = [ 'all' => 0, 'document' => 0, 'comment' => 0, 'multimedia' => 0, 'file' => 0, ]; if ( $where ): $total_count = $output->total_count; $where_list[$where] = $output->total_count; else: if ( !empty($search_result) ): foreach ( $search_result as $target => $output ): if ( $target === 'trackback' ) continue; $total_count = $total_count + $output->total_count; $where_list[$target] = $output->total_count; endforeach; $where_list['all'] = $total_count; endif; endif; }