can I pass arguments to my function through add_action? (Wordpress)

Posted by Radek on Stack Overflow See other posts from Stack Overflow or by Radek
Published on 2010-05-16T10:32:56Z Indexed on 2010/05/16 10:40 UTC
Read the original article Hit count: 147

Filed under:
|

can I do something like that? to pass arguments to my function? I already studied add_action doc but did not figure out how to do it. What the exact syntax to pass two arguments would look like.

function recent_post_by_author($author,$number_of_posts) {
  some commands;
}
add_action('thesis_hook_before_post','recent_post_by_author',10,'author,2')

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about php