WordPress.org

Ready to get started?Download WordPress

Forums

Hook into a plugin (5 posts)

  1. dyrk
    Member
    Posted 3 years ago #

    Hi

    I'm quite familiar with hooking into WordPress. But How do I hook into another plugins functions?

    Thanks in advance

  2. dyrk
    Member
    Posted 3 years ago #

    Just to expand a bit more.

    I'm trying to write a plugin that hooks into Contact Form 7's submit function. There are many extensions for this plugin, so perhaps someone can just give me a brief idea of how to do it?

    Thanks

  3. Joseph G.
    Member
    Posted 3 years ago #

    //example

    function hello_world(){
    echo 'Hi World!';
    }
    add_action('the_post','hello_world');

    //where the 'the_post' is the hook and the 'hello_world' is the function to be executed.

  4. dyrk
    Member
    Posted 3 years ago #

    Thanks dunhakdis

    That's for plugging into WordPress, but what I was really looking for I managed to find last night after sifting through a lot of code.

    To hook into ANOTHER plugin - in this case it was contact form 7 - and indeed it was as easy as plugging into wordpress:

    add_action('wpcf7_before_send_mail', 'my_function');

    Thanks for your help though :-)

  5. Joseph G.
    Member
    Posted 3 years ago #

    You can hook into any functions as long as it is supported though :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags