API Reference

Extend.Filter Class

Description

This class is used to manage all filter plugins in Hexo.

Constructor

Extend.Filter

This class is used to manage all filter plugins in Hexo.

Methods

apply

(type, [args], [callback], [context])

Runs all filter plugins of a specified type.

Parameters

list

([type]) Object | Array

Returns a list of filter plugins. Use type argument to get filter plugins of a specified type.

Parameters

Returns

register

([type=after_post_render], fn, [priority=10])

Registers a filter plugin.

Parameters

  • type String optional

    The type of filter plugins.

  • fn Function
  • priority Number optional

    The execution priority of the plugin. It must be a positive number.

unregister

(type, [fn])

Unregisters a filter plugin.

Parameters

  • type String
  • fn Function optional

    If fn is not defined, all filter plugins of the specified type will be unregistered.

Properties