Habari\Posts::count_by_tag PHP Метод

count_by_tag() публичный статический Метод

static count_by_tag return a count of the number of posts with the assigned tag
public static count_by_tag ( string $tag, mixed $status = false ) : integer
$tag string A tag
$status mixed a status value to filter posts by; if false, then no filtering will be performed
Результат integer the number of posts with the specified tag
    public static function count_by_tag($tag, $status = false)
    {
        $params = array('vocabulary' => array(Tags::vocabulary()->name . ':term_display' => $tag), 'count' => 1);
        if (false !== $status) {
            $params['status'] = $status;
        }
        return self::get($params);
    }