apply

apply is used to call a function. The argument before the pipe becomes function_input, and argument after colon is function name.

Example

Let's assume we have simple function called hello_world defined with below code.

{% assign input = function_input %}
{% assign input["foo"] = "bar" %}
{% global function_output = input %}

Now, you can call this function in hooks code using apply filter:

{% assign fn_input = '{"foo": ""}' | parse %}
{% assign fn_result = fn_input | apply: "hello_world" %}

As a result, value of fn_result will be:

{
"foo": "bar"
}