WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Give object's function for filter param? (4 posts)

  1. frontline
    Member
    Posted 3 years ago #

    Is it possible to pass object's function (for example a static one) to a hook (action/filter doesn't matter) as a parameter? I'm guessing it's very easy but i spent some time trying to do that and ... can't figured out.

    Thank you in advanced.

  2. vtxyzzy
    Member
    Posted 3 years ago #

    Not sure what you want. Can you give more detail and an example?

  3. frontline
    Member
    Posted 3 years ago #

    Well ... i spent more time on it and got the result.

    $obj = new MyObjInstance();
    add_action('admin_init', array($obj, 'registerScripts'));

    That's what i needed. Anyway, 10x for the interest :)

  4. 123milliseconds
    Member
    Posted 3 years ago #

    Please mark thread as resolved so that

    - others with similar problem can see it as resolved and will read this thread for help if they have similar problem

    - people providing help see it as resolved and will not waste time reading this post.

Topic Closed

This topic has been closed to new replies.

About this Topic