1<?php
2
3// The filter callback function.
4function example_callback( $string, $arg1, $arg2 ) {
5 // (maybe) modify $string.
6 return $string;
7}
8add_filter( 'example_filter', 'example_callback', 10, 3 );
9
10/*
11 * Apply the filters by calling the 'example_callback()' function
12 * that's hooked onto `example_filter` above.
13 *
14 * - 'example_filter' is the filter hook.
15 * - 'filter me' is the value being filtered.
16 * - $arg1 and $arg2 are the additional arguments passed to the callback.
17$value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );
18
19