[wp-hackers] Basic filter question

scribu scribu at gmail.com
Mon Sep 15 17:44:27 GMT 2008


Hello, I was wondering if it was possible to pass an extra argument to a
function called from a filter, e.g.


function my_function($content, $extra_argument) {
    // Do something to the $content based on $extra_argument
}

add_filter('the_content', 'my_function', 10, 2, 'extra_argument_value1');
add_filter('the_excerpt', 'my_function', 10, 2, 'extra_argument_value2');


I know I can just have two similar functions, but that's not the idea.

-- 
http://scribu.net


More information about the wp-hackers mailing list