Apply filters before/after post

@filter grotto_wp_posts_post_{$context}

@param string $context 'before' or 'after' post.
@param int $count Current post number/count.
331254
private function filter(
        string $context,
        int $post_id,
        int $count
    ): string {
        return \apply_filters(
            "grotto_wp_posts_post_{$context}",
            '',
            $post_id,
            $count,
            $this->posts->args
        );
    }
61489
private function addTokenToVector($token, $field, $count = 1)
    {
        if (!empty($token)) {
            if (isset($this->tokenVector[$field][$token])) {
                $this->tokenVector[$field][$token] += $count;
            } else {
                $this->tokenVector[$field][$token] = $count;
            }
        }
    }
1098709
public function hasExactCountOfObjects($count): bool
    {
        $this->collectObjects(true);

        return $this->getCountOfObjectsInCollection() === (int)$count;
    }
126936
public function rewind($count)
    {
        $this->pos -= $count;
        if ($this->pos < 0) {
            $this->pos = 0;
        }

        return $this;
    }
58633
public function completed($context = null)
    {
        $rules = $this->getRules();
        foreach ($rules as $rule) {
            $rule->completed($context);
        }
    }
578317
final public function limit(int $offsetOrCount, int $count = null)
    {
        if ($count === null) {
            $this->limit['offset'] = 0;
            $this->limit['count']  = $offsetOrCount;
        } else {
            $this->limit['offset'] = $offsetOrCount;
            $this->limit['count']  = $count;
        }

        return $this;
    }
1207203
private function setCount(int $count): self
    {
        $this->count = max($count, 0);
        if ($this->count > 0) {
            $this->countPages = (int)ceil($this->count / $this->limit);
        } else {
            $this->countPages = 1;
        }

        return $this;
    }
104561
private function query($count)
    {
        $this->applyQueryFilters();

        if ($this->hasTranslating()) {
            $this->applyTranslationFilter();
        }

        if ($this->orderBy()) {
            $this->query = $this->query->orderBy(
                                $this->orderBy(),
                                $this->sortBy()
                            );
        }

        if ($count) {
            return $this->query->count();
        }

        if ($this->perPage > 0) {
            return $this->query->paginate($this->perPage);
        }

        return $this->query->get();
    }
1244184
public void setContext(Context context) {
    super.setContext(context);
    if (null != context) {
      Object count = context.getDatas().get("countPerSheet");
      if (null != count && Numbers.isDigits(count.toString())) {
        int countParam = Numbers.toInt(count.toString());
        if (countParam > 0) this.countPerSheet = countParam;
      }
    }
  }
1350325
public function reportCount($count) {
    $statName = $this->prefix . $this->statNames;
    if ($this->isProduction) {
      stathat_ez_count($this->ezkey, $statName, $count);
    }
  }
488323
def before(self, context):
        ""
        run.before_each.execute(context)
        self._invoke(self._before, context)
898829
public function beforeFilter(Event $event)
    {
        $this->_controller->set('__commentComponentLoaded__', true);
        $this->_controller->set('_commentFormContext', $this->config('arrayContext'));
    }
885716
function after (count, callback, context) {
  var runCount = 0
  var rests = []
  context = context || this
  return function () {
    runCount++
    if (runCount <= count) {
      rests.push(arguments[0])
    }
    if (runCount >= count) {
      callback.apply(context, [rests].concat(arraySlice(arguments)))
    }
  }
}
861578
public function count($count)
    {
        if (!is_int($count)) {
            throw new InvalidIntException('count', $count);
        } elseif ($count < 0) {
            throw new NumberNotGreaterException('count', $count, 0);
        }

        if (!is_array($this->value)) {
            throw new InvalidArrayException($this->name, $this->value);
        }

        if (count($this->value) !== $count) {
            throw new InvalidArrayCountException($this->name, $this->value, $count);
        }

        return $this;
    }
516992
protected function _afterEntityInsert(AnCommandContext $context)
    {
        $this->parent->getRepository()
                     ->getBehavior('commentable')
                     ->resetStats(array($this->parent));
        $this->parent->execute('after.comment', array('comment' => $this));
    }
341318
protected function _afterEntityDelete(AnCommandContext $context)
    {
        $this->votee->getRepository()
                    ->getBehavior('votable')
                    ->resetStats(array($this->votee));
    }
1038367
protected function _afterEntityInsert(AnCommandContext $context)
    {
        if ($this->isOwnable() && $this->owner->isNotifiable() && !$this->owner->eql($this->author)) {
            $this->addSubscriber($this->owner);
        } elseif (!empty($this->author)) {
            $this->addSubscriber($this->author);
        }
    }